From 185724e5e95a4044ac0db857fa6d237907817237 Mon Sep 17 00:00:00 2001 From: Christoph Nelles Date: Sat, 1 Jan 2022 21:36:18 +0100 Subject: [PATCH] Tree: Fix de-select when selection mode set to SELECT_ROW It no longer de-selects an already selected row if the SELECT_MODE is set to SELECT_ROW. Update scene/gui/tree.cpp Co-authored-by: Michael Alexsander --- scene/gui/tree.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 5a6ac7c0d26..9dd9b7e2526 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2195,8 +2195,10 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c */ } else if (c.selected) { - c.selected = false; - //p_current->deselected_signal.call(p_col); + if (p_selected != p_current) { + // Deselect other rows. + c.selected = false; + } } } else if (select_mode == SELECT_SINGLE || select_mode == SELECT_MULTI) { if (!r_in_range && &selected_cell == &c) {