summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-03 16:23:57 +0100
committerGitHub <noreply@github.com>2020-01-03 16:23:57 +0100
commit6f279ed6ebe7f9be1bd1ca852d9a6135c5e059c5 (patch)
tree90e0d70fbeb5b321a66a2521da947ab14e8614ae /scene/gui
parenta18909f9452180c36b62f34dda07fbebb6c863ed (diff)
parentb728d3bd18420020175cb53fd44d8dccbea6bd15 (diff)
Merge pull request #34781 from fossegutten/button-flash
Fixes button flashing when releasing mousebutton outside
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/base_button.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 56467517d1..65912c1c07 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -171,9 +171,17 @@ void BaseButton::on_action_event(Ref<InputEvent> p_event) {
}
}
- if (!p_event->is_pressed()) { // pressed state should be correct with button_up signal
+ if (!p_event->is_pressed()) {
+ Ref<InputEventMouseButton> mouse_button = p_event;
+ if (mouse_button.is_valid()) {
+ if (!has_point(mouse_button->get_position())) {
+ status.hovering = false;
+ }
+ }
+ // pressed state should be correct with button_up signal
emit_signal("button_up");
status.press_attempt = false;
+ status.pressing_inside = false;
}
update();