Skip to content

Commit

Permalink
Merge pull request #20133 from ibrahn/fix-tree-uninit-branch
Browse files Browse the repository at this point in the history
fixed a branch on uninitialised data in gui/tree
  • Loading branch information
akien-mga authored Jul 24, 2018
2 parents a501678 + fb32adf commit f8e8ac2
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions scene/gui/tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
drop_mode_over = it;
drop_mode_section = section;
update();
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();
}
Expand Down

0 comments on commit f8e8ac2

Please sign in to comment.