summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-07-25 01:18:39 +0200
committerGitHub <noreply@github.com>2018-07-25 01:18:39 +0200
commitf8e8ac2c664a12f3af2b9bb545da193d86c75503 (patch)
tree65f48cd5a7a68f788fe55ef3ccc26438ce13d162 /scene
parenta501678ba174f9faa1760ce26ec43d96a01adfa0 (diff)
parentfb32adfcf8baa38b8812204e540a557a90e1dcd5 (diff)
Merge pull request #20133 from ibrahn/fix-tree-uninit-branch
fixed a branch on uninitialised data in gui/tree
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/tree.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 1d27612766..6ab1bf3d58 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -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();
}