From 325a7fef2ac6637d72f28ccea7cb85afecd42e8b Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Tue, 30 Dec 2014 00:14:21 +0300 Subject: [PATCH] Simplify logic --- SDL2pp/Rect.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SDL2pp/Rect.cc b/SDL2pp/Rect.cc index b2bb830..b9a1479 100644 --- a/SDL2pp/Rect.cc +++ b/SDL2pp/Rect.cc @@ -145,7 +145,7 @@ void Rect::SetY2(int y2) { } 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 {