From 8eded9679222d6cfd300b38641c512d22a5e52ac Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 16:39:17 -0800 Subject: [PATCH] PSD: transform a file's clipping path in place instead of copying it file_clipped owns the path psdread::clipping_path reads, so it moves it to the image's place without making a second copy of every anchor. --- crates/engine/src/cmd/fileio/load.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/fileio/load.rs b/crates/engine/src/cmd/fileio/load.rs index e6eab02ad6..7482ed1020 100644 --- a/crates/engine/src/cmd/fileio/load.rs +++ b/crates/engine/src/cmd/fileio/load.rs @@ -1074,8 +1074,8 @@ pub(super) fn raster_doc(name: &str, bytes: &[u8]) -> Result { /// space (a PSD or PSB file's, [`psdread::clipping_path`]): a clip group of that path (even-odd, /// with no paint) and the image. Without one the image stays as it is. pub(crate) fn file_clipped(d: &mut Document, image: Node, clip: Option) -> Node { - let (Some(path), NodeKind::Image(im)) = (clip, &image.kind) else { return image }; - let path = path.transformed(im.xf); + let (Some(mut path), NodeKind::Image(im)) = (clip, &image.kind) else { return image }; + path.transform(im.xf); let none = vectorcraft_color::Paint::None; let mut clip = Node::path(d.alloc_id(), path, vectorcraft_doc::Appearance::basic(none.clone(), none, 0.0)); if let NodeKind::Path { clipping, rule, .. } = &mut clip.kind {