diff --git a/Source/Editor/GUI/Tree/Tree.cs b/Source/Editor/GUI/Tree/Tree.cs index 3e1453f03..8df26c211 100644 --- a/Source/Editor/GUI/Tree/Tree.cs +++ b/Source/Editor/GUI/Tree/Tree.cs @@ -74,9 +74,9 @@ namespace FlaxEditor.GUI.Tree public bool DrawRootTreeLine = true; /// - /// Occurs when the defered layouting happens + /// Occurs when the deferred layout operation was performed. /// - public event Action OnDeferedLayout; + public event Action AfterDeferredLayout; /// /// Gets or sets the margin for the child tree nodes. @@ -380,7 +380,7 @@ namespace FlaxEditor.GUI.Tree if (_deferLayoutUpdate) { base.PerformLayout(); - OnDeferedLayout?.Invoke(); + AfterDeferredLayout?.Invoke(); _deferLayoutUpdate = false; } diff --git a/Source/Editor/Windows/SceneTreeWindow.cs b/Source/Editor/Windows/SceneTreeWindow.cs index 620300485..3c7583b0e 100644 --- a/Source/Editor/Windows/SceneTreeWindow.cs +++ b/Source/Editor/Windows/SceneTreeWindow.cs @@ -92,14 +92,15 @@ namespace FlaxEditor.Windows _tree.SelectedChanged += Tree_OnSelectedChanged; _tree.RightClick += OnTreeRightClick; _tree.Parent = _sceneTreePanel; - _tree.OnDeferedLayout += () => { - if(_forceScrollNodeToView) + _tree.AfterDeferredLayout += () => + { + if (_forceScrollNodeToView) { _forceScrollNodeToView = false; ScrollToSelectedNode(); } }; - + headerPanel.Parent = this; // Setup input actions @@ -151,9 +152,10 @@ namespace FlaxEditor.Windows root.TreeNode.UpdateFilter(query); _tree.UnlockChildrenRecursive(); - + + // When keep the selected nodes in a view var nodeSelection = _tree.Selection; - if(nodeSelection.Count != 0) + if (nodeSelection.Count != 0) { var node = nodeSelection[nodeSelection.Count - 1]; node.Expand(true);