From 572f6c76b03231ff4b22b3f544b626fc77fcafc4 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 24 Apr 2020 15:42:06 +0100 Subject: [PATCH] Properly fixed all gaps on positive bound for scaled volumes --- common/src/volumes/scaled.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/volumes/scaled.rs b/common/src/volumes/scaled.rs index aa7338352e..e650024f1e 100644 --- a/common/src/volumes/scaled.rs +++ b/common/src/volumes/scaled.rs @@ -35,13 +35,13 @@ impl<'a, V: SizedVol> SizedVol for Scaled<'a, V> { fn lower_bound(&self) -> Vec3 { self.inner .lower_bound() - .map2(self.scale, |e, scale| (e as f32 * scale).ceil() as i32) + .map2(self.scale, |e, scale| (e as f32 * scale).floor() as i32) } #[inline(always)] fn upper_bound(&self) -> Vec3 { self.inner .upper_bound() - .map2(self.scale, |e, scale| (e as f32 * scale).ceil() as i32) + .map2(self.scale, |e, scale| ((e as f32 - 1.0) * scale).floor() as i32 + 1) } }