diff --git a/crates/tessellation/src/event_queue.rs b/crates/tessellation/src/event_queue.rs index eb28f162..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, } } @@ -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 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"))] 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 +}