mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 03:18:12 +08:00
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:
@@ -230,7 +230,7 @@ pub fn new_image_layer(image_frame: Table<Raster<CPU>>, id: NodeId, parent: Laye
|
||||
}
|
||||
|
||||
/// Create a new group layer from an SVG string.
|
||||
pub fn new_svg_layer(svg: String, transform: glam::DAffine2, id: NodeId, parent: LayerNodeIdentifier, responses: &mut VecDeque<Message>) -> LayerNodeIdentifier {
|
||||
pub fn new_svg_layer(svg: String, transform: glam::DAffine2, center: bool, id: NodeId, parent: LayerNodeIdentifier, responses: &mut VecDeque<Message>) -> LayerNodeIdentifier {
|
||||
let insert_index = 0;
|
||||
responses.add(GraphOperationMessage::NewSvg {
|
||||
id,
|
||||
@@ -238,6 +238,7 @@ pub fn new_svg_layer(svg: String, transform: glam::DAffine2, id: NodeId, parent:
|
||||
transform,
|
||||
parent,
|
||||
insert_index,
|
||||
center,
|
||||
});
|
||||
LayerNodeIdentifier::new_unchecked(id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user