Fix order when pasting UI Controls

#487
This commit is contained in:
Wojtek Figat
2021-04-29 15:22:36 +02:00
parent c2afe0b6b2
commit d2ac0429d3
5 changed files with 49 additions and 9 deletions

View File

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