mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 21:30:03 -04:00
Add Rect::round
This commit is contained in:
@@ -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]
|
#[must_use]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn intersects(self, other: Self) -> bool {
|
pub fn intersects(self, other: Self) -> bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user