diff --git a/crates/engine/src/cmd/buildcmds/live_paint.rs b/crates/engine/src/cmd/buildcmds/live_paint.rs index 073b0f8bd5..b049f59f0c 100644 --- a/crates/engine/src/cmd/buildcmds/live_paint.rs +++ b/crates/engine/src/cmd/buildcmds/live_paint.rs @@ -331,8 +331,9 @@ fn lp_segments(pd: &PathData) -> Vec { /// face that shares with a face already reached an edge that is hidden or draws no stroke /// ([`unstroked`]). Hidden faces are not reached and do not pass the flood on. A face runs along an /// edge segment over the part of it between the points nearest the ends of one of the face's -/// outline segments, when that part lies within [`LP_JOIN_TOL`] of the outline segment; one outline -/// segment can run along several edge segments. Two faces share the edge where those parts overlap +/// outline segments, when that part's points at a quarter, half and three quarters of its +/// parameter range lie within [`LP_JOIN_TOL`] of the outline segment; one outline segment can run +/// along several edge segments. Two faces share the edge where those parts overlap /// along more than [`LP_JOIN_TOL`], so two faces that a Gap Detection gap parts on the same side of /// an edge, whose parts only touch, do not. fn flood_faces(group: &Node, start: NodeId) -> Vec { diff --git a/crates/tools/src/builder/tests.rs b/crates/tools/src/builder/tests.rs index 80a2dbd7a4..1e22c67b26 100644 --- a/crates/tools/src/builder/tests.rs +++ b/crates/tools/src/builder/tests.rs @@ -1178,6 +1178,15 @@ fn bucket_triple_click_on_a_made_group_skips_open_paths() { let mut look = Appearance::default_art(); look.set_fill(blue); d.insert(Some(l), 1, Node::path(front, PathData::single(SubPath::polyline(&u, false)), look)).unwrap(); + // The face the planar map makes there takes its fill from the square, as the group's would. + let shapes: Vec = [back, front] + .iter() + .enumerate() + .filter_map(|(k, id)| node_outline(d.node(*id)?).map(|(path, rule)| vectorcraft_pathops::Shape::new(path, rule, k as u64))) + .collect(); + let (regions, _) = vectorcraft_pathops::live_paint(&shapes); + let face = regions.iter().find(|r| r.contains(Point::new(75.0, 25.0))).expect("a face at (75, 25)"); + assert_eq!(face.top(), Some(0), "the square is the face's top shape"); let mut s = Selection::default(); s.set([back, front]); let p = paint();