mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Properly fixed all gaps on positive bound for scaled volumes
This commit is contained in:
parent
e84c2aa1db
commit
59f4161f5c
@ -35,13 +35,13 @@ impl<'a, V: SizedVol> SizedVol for Scaled<'a, V> {
|
||||
fn lower_bound(&self) -> Vec3<i32> {
|
||||
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<i32> {
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user