mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 07:18:04 +08:00
Reintroduce improved logic for mesh interior region fill determination (#4464)
This commit is contained in:
committed by
Dennis Kobert
parent
1420ba799a
commit
50cda6b134
@@ -23,6 +23,10 @@ fn path_modify<'e>(
|
||||
modification.apply(&mut element);
|
||||
}
|
||||
|
||||
// Users draw subpaths in arbitrary winding directions, so normalize them here rather than
|
||||
// letting the drawn direction decide fill insideness downstream
|
||||
element.normalize_winding_directions();
|
||||
|
||||
// Set the path to the encapsulating subgraph (drop our own trailing entry from `node_path`),
|
||||
// matching the `path_of_subgraph` proto so editor tools can route data back to the parent layer.
|
||||
let path = match existing.is_empty() {
|
||||
|
||||
@@ -1475,9 +1475,11 @@ pub(crate) fn replace_with_polygons(vector: &mut Vector, polygons: Vec<Vec<DVec2
|
||||
if start == end {
|
||||
continue;
|
||||
}
|
||||
// Emit shared walls in index-canonical direction: a cycle can't be monotone in point index,
|
||||
// so no cell's boundary can wind coherently and read as deliberate negative space
|
||||
let edge = if start < end { (start, end) } else { (end, start) };
|
||||
if seen_edges.insert(edge) {
|
||||
segment_domain.push(next_segment.next_id(), start, end, BezierHandles::Linear);
|
||||
segment_domain.push(next_segment.next_id(), edge.0, edge.1, BezierHandles::Linear);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user