MonoGame.Extended
MonoGame.Extended copied to clipboard
[GUI] StackPanel Padding
Hello,
If padding is set on stackpanel content is indented only from bottom and right Branch: develop
Steps to reproduce: In demo gui set padding on stack panel
var stackTest = new DemoViewModel("Stack Panels",
new StackPanel
{
Padding = 20,
Items =
{
new Button { Content = "Press Me", HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top },
new Button { Content = "Press Me", HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Bottom },
new Button { Content = "Press Me", HorizontalAlignment = HorizontalAlignment.Centre, VerticalAlignment = VerticalAlignment.Centre },
new Button { Content = "Press Me", HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch },
}
});
Possible fix:
In LayoutControl.Update() change line from
Layout(context, new Rectangle(0, 0, ContentRectangle.Width, ContentRectangle.Height));
To
Layout(context, new Rectangle(Padding.Left, Padding.Top, ContentRectangle.Width, ContentRectangle.Height));
Thanks for the bug report.
Moved to v4 as not sure what the future will be for the GUI project. I already removed the NuclexGui
due to some problems and being confusing with this GUI project. There are also other GUI libraries out there like described in this community post.