From 0aac40105e4efbf8107f64df370467bbabe727a9 Mon Sep 17 00:00:00 2001 From: yoriswind Date: Sun, 1 Nov 2026 13:12:39 -0800 Subject: [PATCH] Reject group transparency before modifying the selection --- crates/engine/src/cmd/channel_cmds/refs.rs | 1 + crates/engine/tests/atn_mapped_identifiers.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/crates/engine/src/cmd/channel_cmds/refs.rs b/crates/engine/src/cmd/channel_cmds/refs.rs index bf12284997..1bdf587f67 100644 --- a/crates/engine/src/cmd/channel_cmds/refs.rs +++ b/crates/engine/src/cmd/channel_cmds/refs.rs @@ -171,6 +171,7 @@ fn ref_planes(doc: &Document, layer: Option, active: Option, r .map(|p| p[3]) .collect(), ], + LayerContent::Group(_) => return Err(EngineError::Other("group transparency sources are not supported".into())), // Adjustment and fill layers cover the whole canvas. _ => vec![vec![1.0; area.width() as usize * area.height() as usize]], }, diff --git a/crates/engine/tests/atn_mapped_identifiers.rs b/crates/engine/tests/atn_mapped_identifiers.rs index 40e9304002..a0f54a14cf 100644 --- a/crates/engine/tests/atn_mapped_identifiers.rs +++ b/crates/engine/tests/atn_mapped_identifiers.rs @@ -420,6 +420,12 @@ fn group_transparency_sources_fail_without_changing_selection() { assert_eq!(s.active().unwrap().revision, revision); assert_eq!(s.active().unwrap().history.past_len(), history); assert_eq!(saved(&action).descriptor, Some(descriptor)); + + // The group's explicit mask remains a valid source. + s.execute("layer.layerMask.revealSelection", json!({"layer":group.0})).unwrap(); + s.execute("select.deselect", json!({})).unwrap(); + s.execute("select.loadSelection", json!({"channel":"mask","layer":params["layer"]})).unwrap(); + assert_eq!(s.active().unwrap().doc.selection.as_ref().unwrap().read_region(Rect::from_xywh(0, 0, 2, 1)), vec![1.0, 0.0]); } }