mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Make button aware of it being dragged and reset state, closes #4178
This commit is contained in:
@@ -225,11 +225,21 @@ void BaseButton::_notification(int p_what) {
|
||||
status.hovering=false;
|
||||
update();
|
||||
}
|
||||
if (p_what==NOTIFICATION_DRAG_BEGIN) {
|
||||
|
||||
if (status.press_attempt) {
|
||||
status.press_attempt=false;
|
||||
status.pressing_button=0;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
if (p_what==NOTIFICATION_FOCUS_EXIT) {
|
||||
|
||||
if (status.pressing_button && status.press_attempt) {
|
||||
status.press_attempt=false;
|
||||
status.pressing_button=0;
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user