Merge pull request #7828 from dotCooCoo/fix/trace-seam-fills-clip

Image Trace: seam fills are clipped to the image and skip live shapes
This commit is contained in:
BFlat
2026-11-16 09:32:19 +07:00
committed by GitHub
8 changed files with 618 additions and 121 deletions
+14 -1
View File
@@ -653,7 +653,20 @@ impl Renderer {
if view.shows_outlines() {
let opts = RenderOptions { outline: true, ..f.opts.clone() };
let frame = Frame { opts: &opts, ..*f };
for c in shapes {
// An Abutting trace's seam fills hold no traced outline: a clip group of paths that are
// each stroked without a fill or (on a stretched image, the strokes' outlines) filled
// without a stroke, named "Seam Fills" or, renamed, still the lowest shape, where the
// trace puts it.
let seam_fills = |i: usize, c: &Arc<Node>| {
let one_paint = |m: &Arc<Node>| {
matches!(m.kind, NodeKind::Path { .. } | NodeKind::Compound { .. })
&& m.appearance.fill_paint().is_none() != m.appearance.stroke_paint().is_none()
};
(i == 0 || c.name.as_deref() == Some("Seam Fills"))
&& matches!(&c.kind, NodeKind::Group { clip: true, children }
if children.split_first().is_some_and(|(_, members)| !members.is_empty() && members.iter().all(one_paint)))
};
for (_, c) in shapes.iter().enumerate().filter(|(i, c)| !seam_fills(*i, c)) {
self.draw_outline_member(ctx, &frame, c);
}
}