1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Add Rect::round

This commit is contained in:
Emil Ernerfeldt
2024-09-30 16:44:42 +02:00
parent ce744e6f7a
commit b7ea43f519

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 {