diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-03 05:21:36 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-03 05:21:36 +0200 |
commit | c080342fcd358561af7edc64cea2222880923b93 (patch) | |
tree | 3a1ed6c92b52f7da5630ccf8d662f8e015f66ca5 /src/gui/Button.cpp | |
parent | 2869ef7cec7de6bc744cdba9e753dbd0df4ab65b (diff) |
Add entry with basic text editing and validation for numbers
Diffstat (limited to 'src/gui/Button.cpp')
-rw-r--r-- | src/gui/Button.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gui/Button.cpp b/src/gui/Button.cpp index ad516b5..b530004 100644 --- a/src/gui/Button.cpp +++ b/src/gui/Button.cpp @@ -13,12 +13,7 @@ namespace gsr { bool Button::on_event(mgl::Event &event, mgl::Window&, mgl::vec2f offset) { if(event.type == mgl::Event::MouseMoved) { - const bool inside = mgl::FloatRect(position + offset, size).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(position + offset, size).contains({ (float)event.mouse_move.x, (float)event.mouse_move.y }); } else if(event.type == mgl::Event::MouseButtonPressed) { const bool clicked_inside = mouse_inside; if(clicked_inside && on_click) |