rds1983 / Myra

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

Using margin to position a Panel clips/removes the background, border, and some content #400

Open V414 opened 9 months ago

V414 commented 9 months ago

For some reason adding a margin to a HorizontalStackPanel begins to clip or entirely remove the background colour.

For example, I was creating this new panel to sit below another I made, positioning it using margin, and it wouldn't show the background colour at all, only a small slither of the border:

Myra background issue 1 Myra background issue 2

However, when I removed the margin, it displayed normally: Myra background issue 3 Myra background issue 4

I'm not 100% sure its actually even an issue with just the background, it's almost like the panel position isn't being set correctly, since the child image buttons also didn't move where they should be when the margin was applied (although the label did for some reason).

V414 commented 9 months ago

Just tested this with a normal Panel instead of just a HorizontalStackPanel with the same results.

The work around is just to use Top = 70; instead of margin, but this still isn't expected behaviour, as surely changing the margin should also shift the background/border/child elements.