MonoGame.Extended icon indicating copy to clipboard operation
MonoGame.Extended copied to clipboard

[GUI] StackPanel Padding

Open davidbezdek opened this issue 5 years ago • 2 comments

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 },
                        }
                    });

image

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));

davidbezdek avatar Apr 05 '19 13:04 davidbezdek

Thanks for the bug report.

craftworkgames avatar Apr 08 '19 23:04 craftworkgames

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.

lithiumtoast avatar Jun 30 '20 13:06 lithiumtoast