This commit is contained in:
2023-09-25 22:18:23 +02:00
parent 092d01dcae
commit c96db94de4
14 changed files with 323 additions and 47 deletions

View File

@@ -0,0 +1,19 @@
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;
}
}