From b82d5688b975195e5191f8b11a3b72466b85f7ee Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 3 Mar 2021 19:39:29 +0100 Subject: [PATCH] Deselect column only if belongs to deselected item (cherry picked from commit 5cd5722f6aeebebd0a76dd45657190c2efac478e) --- scene/gui/tree.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 64c6dc55236..b8e71d9fcc7 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3203,11 +3203,11 @@ void Tree::item_selected(int p_column, TreeItem *p_item) { void Tree::item_deselected(int p_column, TreeItem *p_item) { if (selected_item == p_item) { - selected_item = NULL; - } + selected_item = nullptr; - if (selected_col == p_column) { - selected_col = -1; + if (selected_col == p_column) { + selected_col = -1; + } } if (select_mode == SELECT_MULTI || select_mode == SELECT_SINGLE) {