Merge pull request #41876 from madmiraal/fix-40947
Check if old mouse column is still available.
This commit is contained in:
commit
5cc8da9f18
@ -2403,11 +2403,16 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
|
|||||||
cache.hover_cell = col;
|
cache.hover_cell = col;
|
||||||
|
|
||||||
if (it != old_it || col != old_col) {
|
if (it != old_it || col != old_col) {
|
||||||
// Only need to update if mouse enters/exits a button
|
if (old_it && old_col >= old_it->cells.size()) {
|
||||||
bool was_over_button = old_it && old_it->cells[old_col].custom_button;
|
// Columns may have changed since last update().
|
||||||
bool is_over_button = it && it->cells[col].custom_button;
|
|
||||||
if (was_over_button || is_over_button) {
|
|
||||||
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;
|
||||||
|
if (was_over_button || is_over_button) {
|
||||||
|
update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user