aboutsummaryrefslogtreecommitdiff
path: root/src/gui/DropdownButton.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-03 05:21:36 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-03 05:21:36 +0200
commitc080342fcd358561af7edc64cea2222880923b93 (patch)
tree3a1ed6c92b52f7da5630ccf8d662f8e015f66ca5 /src/gui/DropdownButton.cpp
parent2869ef7cec7de6bc744cdba9e753dbd0df4ab65b (diff)
Add entry with basic text editing and validation for numbers
Diffstat (limited to 'src/gui/DropdownButton.cpp')
-rw-r--r--src/gui/DropdownButton.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gui/DropdownButton.cpp b/src/gui/DropdownButton.cpp
index b20dbb4..1d7374b 100644
--- a/src/gui/DropdownButton.cpp
+++ b/src/gui/DropdownButton.cpp
@@ -29,12 +29,7 @@ namespace gsr {
if(event.type == mgl::Event::MouseMoved) {
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
- const bool inside = mgl::FloatRect(draw_pos + collision_margin, size - collision_margin).contains({ (float)event.mouse_move.x, (float)event.mouse_move.y });
- if(mouse_inside && !inside) {
- mouse_inside = false;
- } else if(!mouse_inside && inside) {
- mouse_inside = true;
- }
+ 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) {
const bool clicked_inside = mouse_inside;