summaryrefslogtreecommitdiffstats
path: root/core/src/rectangle.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/rectangle.rs')
-rw-r--r--core/src/rectangle.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/rectangle.rs b/core/src/rectangle.rs
index aa23372e..ce80c661 100644
--- a/core/src/rectangle.rs
+++ b/core/src/rectangle.rs
@@ -126,15 +126,15 @@ impl Rectangle<f32> {
}
}
- /// Rounds the [`Rectangle`] to __unsigned__ integer coordinates.
+ /// Snaps the [`Rectangle`] to __unsigned__ integer coordinates.
///
/// [`Rectangle`]: struct.Rectangle.html
- pub fn round(self) -> Rectangle<u32> {
+ pub fn snap(self) -> Rectangle<u32> {
Rectangle {
x: self.x as u32,
y: self.y as u32,
- width: (self.width + 0.5).round() as u32,
- height: (self.height + 0.5).round() as u32,
+ width: self.width.ceil() as u32,
+ height: self.height.ceil() as u32,
}
}
}