rds1983 / Myra

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

Margin is handled wrong. #385

Open IceReaper opened 1 year ago

IceReaper commented 1 year ago

When adding two TextButton for example in a VerticalStackPanel, giving both a fixed height and the first one a margin-bottom, i expect the buttons to have the same height. However it seems that the Height property includes margins, so the first button ends up being smaller.

While one could argument that this is the box-model myra uses, its super unconvenient because i wont be able to "make all buttons equal heigh". It needs every single buttons height to be calculated with added margin top-bottom.

This is either a bug in the layout formula, or if this is on purpose, i would request a change on how margins are applied. Width / Height should never contain the Margin value.

This strongly reminds me of #376