Skip to content

Commit 2e7cc25

Browse files
committed
fix rectangle snapping
1 parent f2c9b6b commit 2e7cc25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/src/rectangle.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ impl Rectangle<f32> {
203203
}
204204

205205
/// Snaps the [`Rectangle`] to __unsigned__ integer coordinates.
206-
pub fn snap(self) -> Option<Rectangle<u32>> {
206+
pub fn snap(mut self) -> Option<Rectangle<u32>> {
207+
self.width += self.x.fract();
208+
self.height += self.y.fract();
209+
207210
let width = self.width as u32;
208211
let height = self.height as u32;
209212

0 commit comments

Comments
 (0)