From 4c0eb71a4c57842e36a7f62f2e36104405fc3efa Mon Sep 17 00:00:00 2001 From: Nicek Date: Wed, 28 Oct 2026 23:01:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=B2=98=E8=B4=B4=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=A1=AB=E5=85=85=E6=97=B6=E9=81=BF=E5=BC=80=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=B7=B2=E5=8D=A0=E7=94=A8=E7=9A=84=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 目标文件已有同名键但数据不同时,粘贴的 paint 改用复制数据的内容哈希键,避免渲染成目标文件里的图片;目标文件原图片保留给已有图层。 --- crates/engine/src/cmd/edit/props.rs | 15 ++++++++++----- crates/engine/src/property_copy_tests.rs | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/cmd/edit/props.rs b/crates/engine/src/cmd/edit/props.rs index c1479aab..845679de 100644 --- a/crates/engine/src/cmd/edit/props.rs +++ b/crates/engine/src/cmd/edit/props.rs @@ -365,7 +365,7 @@ pub(super) fn paint_copy(s: &mut Session, p: &Value, fills: bool) -> Result Result { let cmd = if fills { "fill.paste" } else { "stroke.paste" }; - let Some((copied_fills, paint)) = s.clipboard.paint.clone() else { + let Some((copied_fills, mut paint)) = s.clipboard.paint.clone() else { return Err(EngineError::Disabled(cmd.into(), "no copied fill or stroke".into())); }; if copied_fills != fills { @@ -386,10 +386,15 @@ pub(super) fn paint_paste(s: &mut Session, p: &Value, fills: bool) -> Result