mirror of
https://github.com/godotengine/godot.git
synced 2024-12-03 09:52:18 +08:00
Reset button state on exit tree
Steps to reproduce a bug: 1) Hold / hover the button 2) Remove it (or parent node) from the tree 3) When we return the button back to the tree, it's pressed / hover
This commit is contained in:
parent
f52c294a74
commit
c7fbc63cc2
@ -282,10 +282,7 @@ void BaseButton::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_EXIT_TREE) {
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_VISIBILITY_CHANGED && !is_visible_in_tree()) {
|
||||
if (p_what == NOTIFICATION_EXIT_TREE || (p_what == NOTIFICATION_VISIBILITY_CHANGED && !is_visible_in_tree())) {
|
||||
|
||||
if (!toggle_mode) {
|
||||
status.pressed = false;
|
||||
|
Loading…
Reference in New Issue
Block a user