Show selected node in Scene dock when parent node is folded
Fix #7228
(cherry picked from commit a192e0785e
)
This commit is contained in:
parent
c07fe5e8de
commit
f184455187
1 changed files with 6 additions and 0 deletions
|
@ -725,6 +725,12 @@ void SceneTreeEditor::set_selected(Node *p_node,bool p_emit_selected) {
|
||||||
TreeItem* item=p_node?_find(tree->get_root(),p_node->get_path()):NULL;
|
TreeItem* item=p_node?_find(tree->get_root(),p_node->get_path()):NULL;
|
||||||
|
|
||||||
if (item) {
|
if (item) {
|
||||||
|
// make visible when it's collapsed
|
||||||
|
TreeItem* node=item->get_parent();
|
||||||
|
while (node && node!=tree->get_root()) {
|
||||||
|
node->set_collapsed(false);
|
||||||
|
node=node->get_parent();
|
||||||
|
}
|
||||||
item->select(0);
|
item->select(0);
|
||||||
item->set_as_cursor(0);
|
item->set_as_cursor(0);
|
||||||
selected=p_node;
|
selected=p_node;
|
||||||
|
|
Loading…
Reference in a new issue