diff options
Diffstat (limited to 'src/gui/Button.cpp')
-rw-r--r-- | src/gui/Button.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/Button.cpp b/src/gui/Button.cpp index 20a771e..6c475bd 100644 --- a/src/gui/Button.cpp +++ b/src/gui/Button.cpp @@ -23,8 +23,10 @@ namespace gsr { const mgl::vec2f item_size = get_size().floor(); if(event.type == mgl::Event::MouseButtonPressed && event.mouse_button.button == mgl::Mouse::Left) { const bool clicked_inside = mgl::FloatRect(position + offset, item_size).contains({ (float)event.mouse_button.x, (float)event.mouse_button.y }); - if(clicked_inside && on_click) + if(clicked_inside && on_click) { on_click(); + return false; + } } return true; } |