Simplify logic

This commit is contained in:
Dmitry Marakasov 2014-12-30 00:14:21 +03:00
parent c584b1a005
commit 325a7fef2a

View File

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