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 12:06:06 +00:00
committed by Keavon Chambers
parent 0c9f457866
commit 002b0fc1dd
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 {