Skip to content

Commit 441051a

Browse files
committed
Remove the cap on the number of iterations when tiling.
This could trigger spuriously for very long lines outside the view box. It still indicates potential performance problem, but we shouldn't crash at least. Closes #416.
1 parent 41ad372 commit 441051a

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

renderer/src/tiler.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,8 @@ fn process_line_segment(line_segment: LineSegment2F,
224224

225225
let (mut current_position, mut tile_coords) = (line_segment.from(), from_tile_coords);
226226
let mut last_step_direction = None;
227-
let mut iteration = 0;
228227

229228
loop {
230-
// Quick check to catch missing the end tile.
231-
debug_assert!(iteration < MAX_ITERATIONS);
232-
233229
let next_step_direction = if t_max.x() < t_max.y() {
234230
StepDirection::X
235231
} else if t_max.x() > t_max.y() {
@@ -302,11 +298,7 @@ fn process_line_segment(line_segment: LineSegment2F,
302298

303299
current_position = next_position;
304300
last_step_direction = next_step_direction;
305-
306-
iteration += 1;
307301
}
308-
309-
const MAX_ITERATIONS: u32 = 1024;
310302
}
311303

312304
#[derive(Clone, Copy, PartialEq, Debug)]

0 commit comments

Comments
 (0)