Optimize ActorTreeNode reparent when it's not collapsed but one of the parents is
This commit is contained in:
@@ -90,6 +90,11 @@ namespace FlaxEditor.GUI.Tree
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the node is collapsed in the hierarchy (is collapsed or any of its parents is collapsed).
|
||||
/// </summary>
|
||||
public bool IsCollapsedInHierarchy => IsCollapsed || (Parent is TreeNode parentNode && parentNode.IsCollapsedInHierarchy);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the text margin.
|
||||
/// </summary>
|
||||
@@ -1058,7 +1063,7 @@ namespace FlaxEditor.GUI.Tree
|
||||
// Expand node if mouse goes over arrow
|
||||
if (ArrowRect.Contains(location) && HasAnyVisibleChild)
|
||||
Expand(true);
|
||||
|
||||
|
||||
if (!_isDragOverHeader)
|
||||
result = OnDragEnterHeader(data);
|
||||
else
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace FlaxEditor.SceneGraph.GUI
|
||||
parentTreeNode.IsLayoutLocked = false;
|
||||
|
||||
// Skip UI update if node won't be in a view
|
||||
if (parentTreeNode.IsCollapsed)
|
||||
if (parentTreeNode.IsCollapsedInHierarchy)
|
||||
{
|
||||
UnlockChildrenRecursive();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user