Skip to content

Commit

Permalink
changed the way contains works to exclude <= for point.y and point.x …
Browse files Browse the repository at this point in the history
…on width and height check to avoid multiple selects
  • Loading branch information
genusistimelord authored and hecrj committed Aug 15, 2023
1 parent 318ee4d commit f9e6255
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/rectangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f9e6255

Please sign in to comment.