diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-03 23:36:11 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-03 23:36:11 +0200 |
commit | 3a20c417cbf7d5db1d9d26abfbda388e58f96c18 (patch) | |
tree | a7552bff0a5164446eaade0dde570cd6111e474d /src/gui/DropdownButton.cpp | |
parent | c080342fcd358561af7edc64cea2222880923b93 (diff) |
Align list items, dont process selected item twice if changed in event loop, mouse button events should only occur when pressing left mouse button
Diffstat (limited to 'src/gui/DropdownButton.cpp')
-rw-r--r-- | src/gui/DropdownButton.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/DropdownButton.cpp b/src/gui/DropdownButton.cpp index 1d7374b..fa51aac 100644 --- a/src/gui/DropdownButton.cpp +++ b/src/gui/DropdownButton.cpp @@ -30,7 +30,7 @@ namespace gsr { const mgl::vec2f draw_pos = position + offset; const mgl::vec2f collision_margin(1.0f, 1.0f); // Makes sure that multiple buttons that are next to each other wont activate at the same time when the cursor is right between them mouse_inside = mgl::FloatRect(draw_pos + collision_margin, size - collision_margin).contains({ (float)event.mouse_move.x, (float)event.mouse_move.y }); - } else if(event.type == mgl::Event::MouseButtonPressed) { + } else if(event.type == mgl::Event::MouseButtonPressed && event.mouse_button.button == mgl::Mouse::Left) { const bool clicked_inside = mouse_inside; if(show_dropdown && clicked_inside && mouse_inside_item == -1) { |