diff --git a/src/bin/flat.rs b/src/bin/flat.rs index 687cced..d4592a8 100644 --- a/src/bin/flat.rs +++ b/src/bin/flat.rs @@ -120,13 +120,10 @@ fn draw_ray_2(gc: &mut Vec, space: &impl Metric, grid: &Grid, base: Vec2, gc.new_path(); gc.move_to(p.x, p.y); let ray = cell.ray_to_local(Ray { pos: p, dir: v }); - if let Some(ray) = cell.to_boundary(ray) { - Ray { pos: p, dir: v } = cell.ray_to_global(ray); - } else { - gc.stroke(); - gc.new_dash_pattern(); - return; - } + let Some(ray) = cell.to_boundary(ray) else { + break; + }; + Ray { pos: p, dir: v } = cell.ray_to_global(ray); gc.line_to(p.x, p.y); gc.stroke(); gc.new_dash_pattern(); @@ -135,6 +132,7 @@ fn draw_ray_2(gc: &mut Vec, space: &impl Metric, grid: &Grid, base: Vec2, } } gc.stroke(); + gc.new_dash_pattern(); } fn draw_fan_2(gc: &mut Vec, space: &impl Metric, grid: &Grid, base: Vec2, dir: Vec2, spread: f32) {