Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions crates/tessellation/src/event_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion crates/tessellation/src/fill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]
Expand Down
6 changes: 3 additions & 3 deletions crates/tessellation/src/stroke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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);
}
}
Loading