19 lines
413 B
C#
19 lines
413 B
C#
using System.Numerics;
|
|
|
|
namespace DaggerFramework.UI;
|
|
|
|
public class MarginPanel : Panel
|
|
{
|
|
public Vector2 RelativeMargin { get; set; }
|
|
public MarginPanel(PanelStyle style) : base(style)
|
|
{
|
|
}
|
|
|
|
protected override void RearrangeChild(int idx, UIElement child)
|
|
{
|
|
base.RearrangeChild(idx, child);
|
|
|
|
var rect = child.Rect;
|
|
rect.Position = Rect.Size * RelativeMargin;
|
|
}
|
|
} |