summaryrefslogtreecommitdiffstats
path: root/core/src/rectangle.rs
diff options
context:
space:
mode:
authorLibravatar Andrew Wheeler(Genusis) <lordsatin@hotmail.com>2023-08-15 01:47:53 -0400
committerLibravatar GitHub <noreply@github.com>2023-08-15 07:47:53 +0200
commitf5b95629009ecde8c6f6388c8f33ec43d30d17d1 (patch)
tree6de6809a378df6f4eced17ae122878c79b63d916 /core/src/rectangle.rs
parent318ee4d548a1e9fd1f2c01616b2a68e95f3bb597 (diff)
downloadiced-f5b95629009ecde8c6f6388c8f33ec43d30d17d1.tar.gz
iced-f5b95629009ecde8c6f6388c8f33ec43d30d17d1.tar.bz2
iced-f5b95629009ecde8c6f6388c8f33ec43d30d17d1.zip
Bounds Contains update. (#2017)
* changed the way contains works to exclude <= for point.y and point.x on width and height check to avoid multiple selects * update changelog * Update `CHANGELOG` --------- Co-authored-by: Héctor Ramón Jiménez <hector0193@gmail.com>
Diffstat (limited to 'core/src/rectangle.rs')
-rw-r--r--core/src/rectangle.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/rectangle.rs b/core/src/rectangle.rs
index db56aa18..c1c2eeac 100644
--- a/core/src/rectangle.rs
+++ b/core/src/rectangle.rs
@@ -74,9 +74,9 @@ impl Rectangle<f32> {
/// 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