mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-12-23 10:11:54 +00:00
Fix issue with pasting an image in the centre
This commit is contained in:
parent
7998947202
commit
cd61daf869
1 changed files with 2 additions and 2 deletions
|
|
@ -539,8 +539,8 @@ impl MessageHandler<DocumentMessage, DocumentInputs<'_>> for DocumentMessageHand
|
|||
let image_size = DVec2::new(image.width as f64, image.height as f64);
|
||||
|
||||
// Align the layer with the mouse or center of viewport
|
||||
let viewport_location = mouse.map_or(ipp.viewport_bounds.center(), |pos| pos.into());
|
||||
let center_in_viewport = DAffine2::from_translation(viewport_location - ipp.viewport_bounds.top_left);
|
||||
let viewport_location = mouse.map_or(ipp.viewport_bounds.center() + ipp.viewport_bounds.top_left, |pos| pos.into());
|
||||
let center_in_viewport = DAffine2::from_translation(self.metadata().document_to_viewport.inverse().transform_point2(viewport_location - ipp.viewport_bounds.top_left));
|
||||
let center_in_viewport_layerspace = center_in_viewport;
|
||||
|
||||
// Scale the image to fit into a 512x512 box
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue