Added performing layout when deleting actors and scrolling to duplicated/ pasted actors when action is performed.

This commit is contained in:
2022-10-16 18:50:00 -05:00
parent f6857f66ba
commit 546501a553
2 changed files with 21 additions and 0 deletions
@@ -450,7 +450,11 @@ namespace FlaxEditor.Modules
SelectionDeleteEnd?.Invoke();
if (isSceneTreeFocus)
{
Editor.Windows.SceneWin.Focus();
Editor.Windows.SceneWin.PerformLayout();
Editor.Windows.SceneWin.PerformLayout();
}
}
/// <summary>
@@ -514,6 +518,9 @@ namespace FlaxEditor.Modules
Undo.AddAction(new MultiUndoAction(pasteAction, selectAction));
OnSelectionChanged();
}
// Scroll to new selected node while pasting
Editor.Windows.SceneWin.ScrollToSelectedNode();
}
/// <summary>
@@ -611,6 +618,9 @@ namespace FlaxEditor.Modules
Undo.AddAction(new MultiUndoAction(undoActions));
OnSelectionChanged();
}
// Scroll to new selected node while duplicating
Editor.Windows.SceneWin.ScrollToSelectedNode();
}
/// <summary>
+11
View File
@@ -209,6 +209,17 @@ namespace FlaxEditor.Windows
if (_sceneTreePanel.HScrollBar != null)
_sceneTreePanel.HScrollBar.ThumbEnabled = enabled;
}
/// <summary>
/// Scroll to selected node in the scene tree
/// </summary>
public void ScrollToSelectedNode()
{
// Scroll to node
var nodeSelection = _tree.Selection;
var scrollPosition = nodeSelection[nodeSelection.Count - 1];
_sceneTreePanel.ScrollViewTo(scrollPosition);
}
private void OnSearchBoxTextChanged()
{