We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2c9b6b commit 2e7cc25Copy full SHA for 2e7cc25
core/src/rectangle.rs
@@ -203,7 +203,10 @@ impl Rectangle<f32> {
203
}
204
205
/// Snaps the [`Rectangle`] to __unsigned__ integer coordinates.
206
- pub fn snap(self) -> Option<Rectangle<u32>> {
+ pub fn snap(mut self) -> Option<Rectangle<u32>> {
207
+ self.width += self.x.fract();
208
+ self.height += self.y.fract();
209
+
210
let width = self.width as u32;
211
let height = self.height as u32;
212
0 commit comments