diff --git a/crates/emath/src/rect.rs b/crates/emath/src/rect.rs index 6c0677ad5..0fb4ac91d 100644 --- a/crates/emath/src/rect.rs +++ b/crates/emath/src/rect.rs @@ -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 {