X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;f=src%2Fwindow.cc;h=608d93b26d1d36e9aeadd5d21f372473808ef135;hb=5449bf8fbca1d2cfbefa0386df7109afb2a5aa34;hp=f3937f14240c417405b319896d947aa2ac03514b;hpb=52e08b5a5e7d44271d217892372c6c0878484c44;p=winnie diff --git a/src/window.cc b/src/window.cc index f3937f1..608d93b 100644 --- a/src/window.cc +++ b/src/window.cc @@ -22,15 +22,10 @@ const Rect &Window::get_rect() const return rect; } -bool Window::contains_ptr(int ptr_x, int ptr_y) +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)