mirror of
https://github.com/libSDL2pp/libSDL2pp.git
synced 2025-08-04 03:15:59 -04:00
Simplify logic
This commit is contained in:
parent
c584b1a005
commit
325a7fef2a
@ -145,7 +145,7 @@ void Rect::SetY2(int y2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Rect::Contains(const Point& point) const {
|
bool Rect::Contains(const Point& point) const {
|
||||||
return !(point.x < x || point.y < y || point.x > GetX2() || point.y > GetY2());
|
return point.x >= x && point.y >= y && point.x <= GetX2() && point.y <= GetY2();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Rect::Contains(const Rect& rect) const {
|
bool Rect::Contains(const Rect& rect) const {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user