Merge pull request #478 from s3bk/patch-3

fix #428
This commit is contained in:
Josh Matthews 2021-10-24 16:21:25 -04:00 committed by GitHub
commit a82bad90da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -287,10 +287,16 @@ fn process_line_segment(line_segment: LineSegment2F,
match next_step_direction {
None => break,
Some(StepDirection::X) => {
if tile_coords.x() == to_tile_coords.x() {
break;
}
t_max += vec2f(t_delta.x(), 0.0);
tile_coords += vec2i(step.x(), 0);
}
Some(StepDirection::Y) => {
if tile_coords.y() == to_tile_coords.y() {
break;
}
t_max += vec2f(0.0, t_delta.y());
tile_coords += vec2i(0, step.y());
}