Added performing layout when deleting actors and scrolling to duplicated/ pasted actors when action is performed.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user