Round document alignment in viewport to avoid AA induced by a shift after zooming in and panning (#921)

This commit is contained in:
0HyperCube
2022-12-28 04:06:06 -08:00
committed by Keavon Chambers
parent d66f09da08
commit 22866acefb
3 changed files with 9 additions and 5 deletions
@@ -21,11 +21,11 @@ impl ViewportBounds {
}
pub fn size(&self) -> DVec2 {
self.bottom_right - self.top_left
(self.bottom_right - self.top_left).ceil()
}
pub fn center(&self) -> DVec2 {
self.bottom_right.lerp(self.top_left, 0.5)
(self.bottom_right - self.top_left).ceil() / 2.
}
pub fn in_bounds(&self, position: ViewportPosition) -> bool {