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>
This commit is contained in:
Andrew Wheeler(Genusis) 2023-08-15 01:47:53 -04:00 committed by GitHub
parent 318ee4d548
commit f5b9562900
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -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