UI WIP
This commit is contained in:
19
DaggerFramework/Source/UI/MarginPanel.cs
Normal file
19
DaggerFramework/Source/UI/MarginPanel.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user