mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 06:48:11 +08:00
Round document alignment in viewport to avoid AA induced by a shift after zooming in and panning (#921)
This commit is contained in:
committed by
Keavon Chambers
parent
0c9f457866
commit
002b0fc1dd
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user