X-Git-Url: https://eleni.mutantstargoat.com/git/?p=winnie;a=blobdiff_plain;f=src%2Fwindow.cc;h=608d93b26d1d36e9aeadd5d21f372473808ef135;hp=84d1004c34a726659911dd46d5034d648aa79301;hb=5449bf8fbca1d2cfbefa0386df7109afb2a5aa34;hpb=094e53b80e5576db6c86bb7dc6141b0cff7fa665 diff --git a/src/window.cc b/src/window.cc index 84d1004..608d93b 100644 --- a/src/window.cc +++ b/src/window.cc @@ -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)