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/Entry.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/Entry.cpp')
-rw-r--r-- | src/gui/Entry.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/Entry.cpp b/src/gui/Entry.cpp index 09ec167..bf0f1ad 100644 --- a/src/gui/Entry.cpp +++ b/src/gui/Entry.cpp @@ -20,7 +20,7 @@ namespace gsr { } bool Entry::on_event(mgl::Event &event, mgl::Window&, mgl::vec2f offset) { - if(event.type == mgl::Event::MouseButtonPressed) { + if(event.type == mgl::Event::MouseButtonPressed && event.mouse_button.button == mgl::Mouse::Left) { selected = mgl::FloatRect(position + offset, get_size()).contains({ (float)event.mouse_button.x, (float)event.mouse_button.y }); } else if(event.type == mgl::Event::KeyPressed && selected) { if(event.key.code == mgl::Keyboard::Backspace && !text.get_string().empty()) { |