summaryrefslogtreecommitdiff
path: root/scene/gui/base_button.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/base_button.cpp')
-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();