Add setter to Control.Center

This commit is contained in:
Wojtek Figat
2021-10-08 15:31:34 +02:00
parent 058e23f3ee
commit 5a35c4ad74

View File

@@ -236,7 +236,12 @@ namespace FlaxEngine.GUI
/// <summary>
/// Gets center position of the control relative to the upper-left corner of its container.
/// </summary>
public Vector2 Center => _bounds.Center;
[HideInEditor, NoSerialize]
public Vector2 Center
{
get => _bounds.Center;
set => Location = value - Size * 0.5f;
}
/// <summary>
/// Gets or sets control's bounds rectangle.