From f9e625575d61dd93634ba618cf7855c84a14933a Mon Sep 17 00:00:00 2001 From: genusistimelord Date: Fri, 11 Aug 2023 13:32:21 -0400 Subject: [PATCH] changed the way contains works to exclude <= for point.y and point.x on width and height check to avoid multiple selects --- core/src/rectangle.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/rectangle.rs b/core/src/rectangle.rs index db56aa18cf..c1c2eeac3c 100644 --- a/core/src/rectangle.rs +++ b/core/src/rectangle.rs @@ -74,9 +74,9 @@ impl Rectangle { /// Returns true if the given [`Point`] is contained in the [`Rectangle`]. pub fn contains(&self, point: Point) -> bool { self.x <= point.x - && point.x <= self.x + self.width + && point.x < self.x + self.width && self.y <= point.y - && point.y <= self.y + self.height + && point.y < self.y + self.height } /// Returns true if the current [`Rectangle`] is completely within the given