Skip to content

VectorCraft: An open-source, vector art tool written by scratch in pure Rust

Variables: an image variable keeps the object's bounds with the Placement Options API on main (#1908)

bflatastica38c824066bc
diff --git a/crates/engine/src/cmd/links.rs b/crates/engine/src/cmd/links.rs
index 1048f527c..3b72828dc 100644
--- a/crates/engine/src/cmd/links.rs
+++ b/crates/engine/src/cmd/links.rs
@@ -486,7 +486,7 @@ pub(crate) fn set_image_from_path(d: &mut Document, id: NodeId, path: &str) -> R
let path = absolute_path(path);
let bytes = read_file(&path)?;
let read = (link_info(&path, &bytes), fileio::raster_image(&bytes)?);
- install(d, &[id], read, true)
+ install(d, &[id], read, Some(Preserve::Bounds))
}
/// Image objects `ids` show the file read for `link` (`img`), each placed as its Placement