Adjust autosizing to better account for text wrapping.

This commit is contained in:
Michael Freno
2025-12-05 11:51:26 -05:00
parent 873299833b
commit ae2d28f6b1
2 changed files with 200 additions and 41 deletions

View File

@@ -1737,8 +1737,12 @@ function TestElementAutoSizing:test_autosize_with_margin()
parent = parent,
})
-- Parent should size to children (margins don't add to content size in flex layout)
luaunit.assertEquals(parent.width, 200)
-- Parent should size to children including margins (flexbox includes margins in sizing)
-- Child1: 100px + 20px right margin = 120px
-- Child2: 20px left margin + 100px = 120px
-- Total width: 240px
-- Max height: 100px (no vertical margins)
luaunit.assertEquals(parent.width, 240)
luaunit.assertEquals(parent.height, 100)
end