Fix image and SVG import transform bugs (#3942)

* Fix half-pixel offset on imported images

* Break out reused function

* Fix SVG/image open flow placing content with unnecessary Transform nodes

* Fix redundant Transform nodes when opening SVG/image files as documents

* Offset the parent to its destination position not the child objects

* Fix SVG/image File > Open artboard dimensions, origin, and clipping

* Fix the SVG to drag in at the mouse position relative to its visible center

* Fix importing images into offset artboards so they don't get offset as well

* Code review
This commit is contained in:
Keavon Chambers
2026-03-23 16:26:10 -07:00
committed by GitHub
parent a10092c10c
commit 11b7af61ef
8 changed files with 174 additions and 57 deletions
+2
View File
@@ -8,6 +8,8 @@ pub const IMPORTS_TO_LEFT_EDGE_PIXEL_GAP: u32 = 120;
pub const STACK_VERTICAL_GAP: i32 = 3;
/// Horizontal grid indentation of a child layer relative to its parent layer.
pub const LAYER_INDENT_OFFSET: i32 = 8;
/// Horizontal grid width of a non-layer node in a chain.
pub const NODE_CHAIN_WIDTH: i32 = 7;
// VIEWPORT
pub const VIEWPORT_ZOOM_WHEEL_RATE: f64 = (1. / 600.) * 3.;