Skip to content
Open
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
25 changes: 22 additions & 3 deletions crates/epaint/src/tessellator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,10 @@ impl Tessellator {
return;
}

if path_shape.closed && path_shape.points.iter().any(|p| p.any_nan()) {
return;
}

if self.options.coarse_tessellation_culling
&& !path_shape.visual_bounding_rect().intersects(self.clip_rect)
{
Expand Down Expand Up @@ -1744,10 +1748,25 @@ impl Tessellator {
"You asked to fill a path that is not closed. That makes no sense."
);

self.scratchpad_path.add_open_points(points);
let mut start = 0;
while start < points.len() {
while start < points.len() && points[start].any_nan() {
start += 1;
}
let mut end = start;
while end < points.len() && !points[end].any_nan() {
end += 1;
}
if end - start > 1 {
self.scratchpad_path.add_open_points(&points[start..end]);

self.scratchpad_path
.stroke(self.feathering, PathType::Open, stroke, out);
self.scratchpad_path
.stroke(self.feathering, PathType::Open, stroke, out);

self.scratchpad_path.clear();
}
start = end;
}
}
}

Expand Down