Merge pull request #20133 from ibrahn/fix-tree-uninit-branch

fixed a branch on uninitialised data in gui/tree
This commit is contained in:
Rémi Verschelde 2018-07-25 01:18:39 +02:00 committed by GitHub
commit f8e8ac2c66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2426,14 +2426,23 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
int col, h, section;
TreeItem *it = _find_item_at_pos(root, mpos, col, h, section);
if ((drop_mode_flags && it != drop_mode_over) || section != drop_mode_section) {
if (drop_mode_flags) {
if (it != drop_mode_over) {
drop_mode_over = it;
update();
}
if (it && section != drop_mode_section) {
drop_mode_section = section;
update();
}
}
if (it != cache.hover_item || col != cache.hover_cell) {
if (it != cache.hover_item) {
cache.hover_item = it;
update();
}
if (it && col != cache.hover_cell) {
cache.hover_cell = col;
update();
}