diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-24 14:08:25 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-24 14:08:25 +0200 |
commit | b8e6949dfb8a88c832e82f8b7e853fe0ed462da0 (patch) | |
tree | 596f3f33b44aee1feb4d28477f4270ad826434b2 /src/gui/Button.cpp | |
parent | 54c60d9a18d103011a12939c5029dd35a8e9e200 (diff) |
Remove scrollable page from gsr page, fix crash when navigating back
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; } |