From 16d1bc2f1f1e8aa8ac603bbf151244607bd60bbb Mon Sep 17 00:00:00 2001 From: Khawar Zamman Wani Date: Thu, 22 Oct 2026 08:31:29 +0530 Subject: [PATCH] fix(retouch): carry the Smudge pickup neighborhood through with_effect_on main split LiveDab's constructor into with_effect (session) and with_effect_on (a prepared document copy) after #7848's fix was written, so the cherry-picked fix no longer compiled. with_effect_on keeps its halo signature for the eraser and Pattern Stamp callers; the body moves to with_neighborhood_on, which Smudge's live stroke reaches through with_neighborhood. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/retouch_cmds.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/retouch_cmds.rs b/crates/engine/src/retouch_cmds.rs index db47fcacec5..eae429f8c0c 100644 --- a/crates/engine/src/retouch_cmds.rs +++ b/crates/engine/src/retouch_cmds.rs @@ -1309,7 +1309,7 @@ impl LiveDab { let st = s.active().ok_or(EngineError::NoDocument)?; let base = (st.doc.id, st.revision); let doc = (*st.doc).clone(); - let mut live = Self::with_effect_on(doc, cmd, p, stroke, id, halo, effect)?; + let mut live = Self::with_neighborhood_on(doc, cmd, p, stroke, id, neighborhood, effect)?; live.base = Some(base); Ok(live) } @@ -1317,13 +1317,25 @@ impl LiveDab { /// [`Self::with_effect`] on `doc`, a copy of the active document with what the commit's own /// edit does first (the Background Eraser's Background turned into a normal layer, say). pub(crate) fn with_effect_on( - mut doc: Document, + doc: Document, cmd: &str, p: &Value, stroke: Stroke, id: Option, halo: i32, effect: impl FnOnce(&Surface) -> DabEffect, + ) -> Result { + Self::with_neighborhood_on(doc, cmd, p, stroke, id, DabNeighborhood::Halo(halo), effect) + } + + fn with_neighborhood_on( + mut doc: Document, + cmd: &str, + p: &Value, + stroke: Stroke, + id: Option, + neighborhood: DabNeighborhood, + effect: impl FnOnce(&Surface) -> DabEffect, ) -> Result { let sel = doc.selection.clone(); let (surf, lock) = crate::channel_cmds::target_surface(&mut doc, id, p)?;