Fixes button flashing when releasing mousebutton outside
This commit is contained in:
parent
2ee6f42759
commit
b728d3bd18
1 changed files with 9 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue