Format code

#3526
This commit is contained in:
Wojtek Figat
2025-06-16 14:48:18 +02:00
parent a05ca12770
commit a6a2fd2c66
2 changed files with 10 additions and 8 deletions

View File

@@ -74,9 +74,9 @@ namespace FlaxEditor.GUI.Tree
public bool DrawRootTreeLine = true;
/// <summary>
/// Occurs when the defered layouting happens
/// Occurs when the deferred layout operation was performed.
/// </summary>
public event Action OnDeferedLayout;
public event Action AfterDeferredLayout;
/// <summary>
/// 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;
}

View File

@@ -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);