@@ -288,6 +288,13 @@ namespace FlaxEditor.SceneGraph
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Action called after pasting actor in editor.
|
||||
/// </summary>
|
||||
public virtual void PostPaste()
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void OnParentChanged()
|
||||
{
|
||||
|
||||
@@ -25,5 +25,20 @@ namespace FlaxEditor.SceneGraph.Actors
|
||||
if (Actor is UIControl uiControl)
|
||||
DebugDraw.DrawWireBox(uiControl.Bounds, Color.BlueViolet);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PostPaste()
|
||||
{
|
||||
base.PostPaste();
|
||||
|
||||
var control = ((UIControl)Actor).Control;
|
||||
if (control != null)
|
||||
{
|
||||
if (control.Parent != null)
|
||||
control.Parent.PerformLayout();
|
||||
else
|
||||
control.PerformLayout();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user