Check if old mouse column is still available.

(cherry picked from commit 79802b31a9)
This commit is contained in:
Marcel Admiraal 2020-09-08 10:20:07 +01:00 committed by Rémi Verschelde
parent 43b49607bb
commit f26131fca5
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 9 additions and 4 deletions

View File

@ -2514,6 +2514,10 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
cache.hover_cell = col;
if (it != old_it || col != old_col) {
if (old_it && old_col >= old_it->cells.size()) {
// Columns may have changed since last update().
update();
} else {
// Only need to update if mouse enters/exits a button
bool was_over_button = old_it && old_it->cells[old_col].custom_button;
bool is_over_button = it && it->cells[col].custom_button;
@ -2523,6 +2527,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
}
}
}
}
// Update if mouse enters/exits columns
if (cache.hover_type != old_hover || cache.hover_index != old_index) {