Fix scrolling to selected actor in scene tree if parent is collapsed

This commit is contained in:
Wojtek Figat
2021-08-04 11:36:27 +02:00
parent 1c9abef342
commit 04c807aea5
2 changed files with 4 additions and 2 deletions

View File

@@ -97,6 +97,7 @@ namespace FlaxEditor.Windows.Assets
// For single node selected scroll view so user can see it
if (nodes.Count == 1)
{
nodes[0].ExpandAllParents(true);
ScrollViewTo(nodes[0]);
}
}

View File

@@ -282,10 +282,10 @@ namespace FlaxEditor.Windows
/// <inheritdoc />
public override void OnInit()
{
Editor.SceneEditing.SelectionChanged += OnOnSelectionChanged;
Editor.SceneEditing.SelectionChanged += OnSelectionChanged;
}
private void OnOnSelectionChanged()
private void OnSelectionChanged()
{
_isUpdatingSelection = true;
@@ -312,6 +312,7 @@ namespace FlaxEditor.Windows
// For single node selected scroll view so user can see it
if (nodes.Count == 1)
{
nodes[0].ExpandAllParents(true);
ScrollViewTo(nodes[0]);
}
}