From 4ce677dd11a9633c1a47d956ed9e358a04dd1c03 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Sun, 8 Mar 2026 15:35:15 +0100 Subject: [PATCH 1/4] Remove unused EventQueue::clear --- crates/tessellation/src/event_queue.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/crates/tessellation/src/event_queue.rs b/crates/tessellation/src/event_queue.rs index eb28f162..38567ade 100644 --- a/crates/tessellation/src/event_queue.rs +++ b/crates/tessellation/src/event_queue.rs @@ -273,12 +273,6 @@ impl EventQueue { self.events[prev as usize].next_event = idx; } - pub(crate) fn clear(&mut self) { - self.events.clear(); - self.first = INVALID_EVENT_ID; - self.sorted = false; - } - /// Returns the ID of the first event in the queue. pub(crate) fn first_id(&self) -> TessEventId { self.first From 7a7e064c1e3d9399896be442d60106e48c4883c9 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Sun, 8 Mar 2026 15:36:33 +0100 Subject: [PATCH 2/4] Fix EventQueue::with_capacity initialization of first --- crates/tessellation/src/event_queue.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/tessellation/src/event_queue.rs b/crates/tessellation/src/event_queue.rs index 38567ade..ea88fd86 100644 --- a/crates/tessellation/src/event_queue.rs +++ b/crates/tessellation/src/event_queue.rs @@ -64,7 +64,7 @@ impl EventQueue { EventQueue { events: Vec::with_capacity(cap), edge_data: Vec::with_capacity(cap), - first: 0, + first: INVALID_EVENT_ID, sorted: false, } } From 1736c367634d094aec28e5b68addbb9cafda5148 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Sun, 8 Mar 2026 15:41:21 +0100 Subject: [PATCH 3/4] Use the same fold detection check in the two stronking paths --- crates/tessellation/src/stroke.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/tessellation/src/stroke.rs b/crates/tessellation/src/stroke.rs index b96edae6..5a92f77b 100644 --- a/crates/tessellation/src/stroke.rs +++ b/crates/tessellation/src/stroke.rs @@ -2094,7 +2094,7 @@ fn compute_join_side_positions( let d_next = extruded_normal.dot(v1) - next_length; let d_prev = extruded_normal.dot(-v0) - prev_length; - if d_next.min(d_prev) >= 0.0 || normal.square_length() < 1e-5 { + if d_next.min(d_prev) > 0.0 || normal.square_length() < 1e-5 { // Case of an overlapping stroke. In order to prevent the back vertex to create a // spike outside of the stroke, we simply don't create it and we'll "fold" the join // instead. @@ -3396,7 +3396,7 @@ fn correct_miter_clip_length() { .with_line_width(line_width) .with_line_join(LineJoin::MiterClip) .with_miter_limit(miter_limit); - + let mut mesh = VertexBuffers::new(); let mut builder = simple_builder(&mut mesh); tessellator @@ -3413,4 +3413,4 @@ fn correct_miter_clip_length() { let expected_max_y = path_max_y + line_width * miter_limit * 0.5; assert_eq!(expected_max_y, max_y); -} \ No newline at end of file +} From aa77dd6165fa5b144e18078d0e28969f1cb11e38 Mon Sep 17 00:00:00 2001 From: Nicolas Silva Date: Sun, 8 Mar 2026 15:45:15 +0100 Subject: [PATCH 4/4] Fix the slope calculation for the sort key of fill active edges In practice this most likely make a real difference but MIN_POSITIVE is truer to what the code intended to enforce (y is guaranteed to be positive here, we just don't want it to be zero). --- crates/tessellation/src/fill.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/tessellation/src/fill.rs b/crates/tessellation/src/fill.rs index 0306898d..5ad6adf9 100644 --- a/crates/tessellation/src/fill.rs +++ b/crates/tessellation/src/fill.rs @@ -62,7 +62,7 @@ fn fmax(a: f32, b: f32) -> f32 { } fn slope(v: Vector) -> f32 { - v.x / (v.y.max(f32::MIN)) + v.x / (v.y.max(f32::MIN_POSITIVE)) } #[cfg(all(debug_assertions, feature = "std"))]