* in progress *
[winnie] / src / window.cc
index 84d1004..608d93b 100644 (file)
@@ -24,13 +24,8 @@ const Rect &Window::get_rect() const
 
 bool Window::contains_point(int ptr_x, int ptr_y)
 {
-       if((rect.x <= ptr_x) && ((rect.x + rect.width) >= ptr_x)) {
-               if((rect.y <= ptr_y) && (ptr_y <= (rect.y + rect.height))) {
-                       return true;
-               }
-       }
-
-       return false;
+       return ptr_x >= rect.x && ptr_x < rect.x + rect.width &&
+                       ptr_y >= rect.y && ptr_y < rect.y + rect.height;
 }
 
 void Window::move(int x, int y)