Open IceReaper opened 1 year ago
Sorry for the late response. So you propose that the margin should be added to the Width/Height? And if the Widget has Width/Height set to 100/100 and Margin set to 10, then it's size should be 110/110. It's definitely reasonable. Though probably need to look how fixed size/margin is handled in other UI libraries. Before making decision on how it'll be in Myra.
Fixes #385 The
width
/Height
properties are always withoutmargin
. Basicalycontent
+padding
+border
. Theresult
variable here however needs to calculate the outer bounds of space consumed, which includesmargin
. This is also stated in the lines directly above, whereMBPWith
andMBPHeight
is added. The statements below override the resulting dimensions, but totaly forget to add themargin
, which this PR fixes.Code example:
Before this PR:![image](https://user-images.githubusercontent.com/1322277/208057452-7162a4ee-2dcd-42b0-b02d-d757f922d002.png)
With this PR:![image](https://user-images.githubusercontent.com/1322277/208057334-c0f8ff99-f58e-44be-8327-465ff8c837d7.png)