rds1983 / Myra

UI Library for MonoGame, FNA and Stride
MIT License
704 stars 94 forks source link

VerticalStackPanel spacing applies even when a child item isn't visible #395

Open V414 opened 11 months ago

V414 commented 11 months ago

Unlike with a child elements margin and padding, which is hidden correctly when a child element is invisible, the spacing space is still added in the VerticalStackPanel:

Myra Spacing Issue (This screenshot shows the hidden content at the top of the bottom left panel)

Myra Spacing Issue 2 (This screenshot shows when that content is set to .Visible = false, leading to extra space still being added when it shouldn't be.

And for completion's sake, here's the code used by the verticalstackpanel: HexData = new VerticalStackPanel(); HexData.Background = new SolidBrush(new Color(10, 22, 34)); HexData.HorizontalAlignment = HorizontalAlignment.Left; HexData.VerticalAlignment = VerticalAlignment.Top; HexData.Padding = new Thickness(10); HexData.Width = 300; HexData.Height = 500; HexData.Spacing = 15; //This is the bit that doesn't work with hidden elements MenuPanel.AddChild(HexData);

It would be awesome if this could be fixed at some point?