From 2ea35324b7acc9c1150c56a11cbcd631b89071bb Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 20 Nov 2026 15:53:47 -0800 Subject: [PATCH] Pathfinder: Outline of a compound shape with no fill adds no stroke of its own The paint source for a compound shape's area held every painting item of the shape, strokes included. When the shape had no fill, Outline fell back to that stroke and gave the edges a 1 pt stroke in its paint, while the shape's own appearance stroked the result again. The area now takes only the shape's top painting fill, so an unfilled compound shape's Outline edges carry no paint of their own. --- crates/effects/src/group.rs | 5 +++-- crates/effects/src/group/tests.rs | 19 +++++++++++++++++++ docs/mcp.md | 3 ++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/crates/effects/src/group.rs b/crates/effects/src/group.rs index aeffaacfb6..eaaf6a99e8 100644 --- a/crates/effects/src/group.rs +++ b/crates/effects/src/group.rs @@ -583,9 +583,10 @@ pub fn pathfinder_children(doc: Option<&Document>, group: &Node, hook: Option Option { diff --git a/crates/effects/src/group/tests.rs b/crates/effects/src/group/tests.rs index 1c62508347..345bb4a0bd 100644 --- a/crates/effects/src/group/tests.rs +++ b/crates/effects/src/group/tests.rs @@ -263,6 +263,25 @@ fn outline_strokes_a_compound_shapes_area_in_its_fill() { } } +/// Outline of a compound shape with no fill gives the edges no paint of their own when Remove +/// Unpainted Artwork is off. The shape's own appearance strokes the result, so the shape's stroke +/// is not copied onto the edges. +#[test] +fn outline_of_an_unfilled_compound_shape_adds_no_stroke() { + let mut g = compound_shape(ShapeMode::Add); + let mut a = Appearance::basic(Paint::None, Paint::solid(Color::BLACK), 4.0); + if let Some(AppearanceItem::Stroke(s)) = a.items.last_mut() { + s.opacity = 0.5; + } + g.appearance = a.into(); + g.appearance.effects.push(Effect { id: "pathfinder.outline".into(), params: serde_json::json!({"removeUnpainted": false}), visible: true }); + let out = pathfinder_children(None, &g, None).unwrap(); + assert!(!out.is_empty(), "{out:#?}"); + for n in &out { + assert!(!n.appearance.items.iter().any(paints), "{n:#?}"); + } +} + /// With Remove Unpainted Artwork, Divide keeps the pieces of an unfilled member when its group's /// own visible fill paints them and leaves them out when the group has no fill. Outline leaves out /// the member's segments either way. diff --git a/docs/mcp.md b/docs/mcp.md index e7abf476a9..f696d61045 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -6218,7 +6218,8 @@ Each Effect › Pathfinder effect (`pathfinder.add` … `pathfinder.softMix`, no in its params: `precision` (a number, 0.001–10 pt), `removeRedundantPoints` and `removeUnpainted` (true or false), which mean what they mean for the panel's operations; the other operations ignore `removeUnpainted`. With `removeUnpainted` on, a compound shape's area counts as filled when the shape has a visible fill of its own, and Divide keeps every piece -when the group or compound shape has one. Outline strokes a compound shape's area in the shape's own fill. `effect.apply` +when the group or compound shape has one. Outline strokes a compound shape's area in the shape's own fill, and gives +the edges no paint when the shape has no fill (the shape's own strokes still draw over the result). `effect.apply` fills the ones `params` leave out from the current Pathfinder Options, and the values join its journal entry. An effect saved without them evaluates with precision 0.01 and both switches off, as before effects kept them. `effect.setParams {index, params: {precision?, removeRedundantPoints?, removeUnpainted?}}` edits them as one undo step; values the