summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-16 09:56:34 +0100
committerGitHub <noreply@github.com>2021-02-16 09:56:34 +0100
commit866cad9767222e70f802b24e930b606e8f0bef62 (patch)
treea64b4dd9f0e9d9e3a72149cbb27943cbbf9695f7 /scene
parentc1dc38679fff37ed5b9fba820095a18e1487406b (diff)
parent282639d6533a51ed395253ee72a9473b326f0b11 (diff)
Merge pull request #46079 from KoBeWi/the_selection
Select TreeItem if none is selected
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/tree.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index c9bc38c36a..ad06739da9 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -3342,6 +3342,9 @@ void Tree::item_selected(int p_column, TreeItem *p_item) {
//emit_signal("multi_selected",p_item,p_column,true); - NO this is for TreeItem::select
selected_col = p_column;
+ if (!selected_item) {
+ selected_item = p_item;
+ }
} else {
select_single_item(p_item, root, p_column);
}