Add Rect::round

This commit is contained in:
Emil Ernerfeldt
2024-09-30 16:44:42 +02:00
parent ce744e6f7a
commit b7ea43f519
+10
View File
@@ -245,6 +245,16 @@ impl Rect {
)
}
/// Round to integer
#[must_use]
#[inline]
pub fn round(self) -> Self {
Self {
min: self.min.round(),
max: self.max.round(),
}
}
#[must_use]
#[inline]
pub fn intersects(self, other: Self) -> bool {