diff --git a/crates/renderer/src/util.rs b/crates/renderer/src/util.rs index a3c86d2..b2cf3aa 100644 --- a/crates/renderer/src/util.rs +++ b/crates/renderer/src/util.rs @@ -301,6 +301,23 @@ impl Rect2D { }, ] } + + #[allow(dead_code)] + pub fn top_left(&self) -> glam::IVec2 { + self.top_left + } + #[allow(dead_code)] + pub fn size(&self) -> glam::IVec2 { + self.bottom_right - self.top_left + } + #[allow(dead_code)] + pub fn width(&self) -> i32 { + self.bottom_right.x - self.top_left.x + } + #[allow(dead_code)] + pub fn height(&self) -> i32 { + self.bottom_right.y - self.top_left.y + } } pub fn eq_f32(lhs: f32, rhs: f32) -> bool {