X-Git-Url: https://eleni.mutantstargoat.com/git/?p=winnie;a=blobdiff_plain;f=src%2Fwindow.cc;h=84d1004c34a726659911dd46d5034d648aa79301;hp=880a6ed9c98445f78af89b95f754cc3e23a75eaf;hb=5deac1a20d178aa7d2e8bb5cbc79b6584c6287f5;hpb=ffd2c0a0f8b898cb4199a0c63aff255a85cc0f11 diff --git a/src/window.cc b/src/window.cc index 880a6ed..84d1004 100644 --- a/src/window.cc +++ b/src/window.cc @@ -22,6 +22,17 @@ const Rect &Window::get_rect() const return rect; } +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; +} + void Window::move(int x, int y) { invalidate(); // moved, should redraw, MUST BE CALLED FIRST