From 1950843de4b5d80d7087066833e5a42fde29c46d Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 21 Sep 2019 08:03:14 -0700 Subject: [PATCH] these rect methods should have been public --- window/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/window/src/lib.rs b/window/src/lib.rs index 160f4b254..fd0720be9 100644 --- a/window/src/lib.rs +++ b/window/src/lib.rs @@ -70,26 +70,26 @@ impl Rect { } #[inline] - fn left(&self) -> isize { + pub fn left(&self) -> isize { self.top_left.x } #[inline] - fn top(&self) -> isize { + pub fn top(&self) -> isize { self.top_left.y } #[inline] - fn right(&self) -> isize { + pub fn right(&self) -> isize { self.top_left.x + self.width as isize } #[inline] - fn bottom(&self) -> isize { + pub fn bottom(&self) -> isize { self.top_left.y + self.height as isize } - fn enclosing_boundary_with(&self, other: &Rect) -> Self { + pub fn enclosing_boundary_with(&self, other: &Rect) -> Self { let left = self.left().min(other.left()); let right = self.right().max(other.right()); @@ -104,7 +104,7 @@ impl Rect { } // https://stackoverflow.com/a/306379/149111 - fn intersects_with(&self, other: &Rect) -> bool { + pub fn intersects_with(&self, other: &Rect) -> bool { let x_overlaps = value_in_range(self.left(), other.left(), other.right()) || value_in_range(other.left(), self.left(), self.right());