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