diff --git a/libui/src/Container.cpp b/libui/src/Container.cpp index d188a07f..d7f320db 100644 --- a/libui/src/Container.cpp +++ b/libui/src/Container.cpp @@ -26,7 +26,8 @@ namespace ui Result Container::handle_mouse_move(Point position) { - return m_widget->handle_mouse_move(position); + if (m_widget->rect().contains(position)) return m_widget->handle_mouse_move(position); + return ui::EventResult::DidNotHandle; } Result Container::handle_mouse_leave() @@ -36,12 +37,14 @@ namespace ui Result Container::handle_mouse_down(Point position, int buttons) { - return m_widget->handle_mouse_down(position, buttons); + if (m_widget->rect().contains(position)) return m_widget->handle_mouse_down(position, buttons); + return ui::EventResult::DidNotHandle; } Result Container::handle_mouse_up(Point position, int buttons) { - return m_widget->handle_mouse_up(position, buttons); + if (m_widget->rect().contains(position)) return m_widget->handle_mouse_up(position, buttons); + return ui::EventResult::DidNotHandle; } Result Container::draw(Canvas& canvas)