Expand tree if necessary, so the selected node will be shown

This commit is contained in:
Zode
2025-06-07 22:53:07 +03:00
committed by GitHub
parent 53e3cee196
commit 74000fa766

View File

@@ -142,9 +142,21 @@ namespace FlaxEditor.Windows
root.TreeNode.UpdateFilter(query);
_tree.UnlockChildrenRecursive();
var nodeSelection = _tree.Selection;
if(nodeSelection.Count != 0)
{
var node = nodeSelection[nodeSelection.Count - 1];
node.Expand(true);
}
PerformLayout();
PerformLayout();
ScrollToSelectedNode();
if(nodeSelection.Count != 0)
{
ScrollToSelectedNode();
}
}
private void Spawn(Type type)