feat(layout): static (non-flex) layouts now shrink the root box to fit the contents. See #2035

This commit is contained in:
Folke Lemaitre 2025-10-11 11:08:10 +02:00
parent d91fc7d3fa
commit ba7845bb85
No known key found for this signature in database
GPG key ID: 9B52594D560070AB

View file

@ -363,6 +363,11 @@ function M:update_box(box, parent)
offset = offset + dims[c][size_main]
end
-- if we still have free space, shrink the root box
if free_main > 0 and is_root then
orig_dim[size_main] = orig_dim[size_main] - free_main
end
-- update box win
local box_win = self.box_wins[box.id]
if box_win then