From 289b16fa7b41dcd502860881992717edcb09d021 Mon Sep 17 00:00:00 2001 From: Dawid Marzec Date: Sat, 12 Nov 2022 01:02:36 +0100 Subject: [PATCH] Fix errors while deselecting all tree items; issue #65185 (cherry picked from commit d4d5df2314208a99c589456a75299a334672acd2) --- scene/gui/tree.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 3f3b85cc3..1600358f2 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -3095,7 +3095,9 @@ Tree::SelectMode Tree::get_select_mode() const { void Tree::deselect_all() { TreeItem *item = get_next_selected(get_root()); while (item) { - item->deselect(selected_col); + for (int i = 0; i < columns.size(); i++) { + item->deselect(i); + } TreeItem *prev_item = item; item = get_next_selected(get_root()); ERR_FAIL_COND(item == prev_item);