From da413ef4e4c01e4570fad26384d60a71d5c7f039 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Mon, 25 Jul 2022 14:20:15 -0500 Subject: [PATCH] Ensure width/height are positive. --- src/visibility.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/visibility.rs b/src/visibility.rs index 43026f4..f385e01 100644 --- a/src/visibility.rs +++ b/src/visibility.rs @@ -88,8 +88,8 @@ impl Viewshed { let shape = Collider::cuboid(0.5, 0.5); let mut new_visible_entities = HashSet::new(); let size = ( - (start.translation.x + self.range as f32) as u32, - (start.translation.y + self.range as f32) as u32, + (start.translation.x.abs() + self.range as f32) as u32, + (start.translation.y.abs() + self.range as f32) as u32, ); let visibility_grid = VisibilityGrid( size,