Merge pull request #27796 from Leytak/patch-2

Reset button state on exit tree
This commit is contained in:
Rémi Verschelde 2019-04-30 11:05:09 +02:00 committed by GitHub
commit 4f10a08d1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -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;