a18e3508f6
The fit function is called twice in row. - The first time it gets the maximum available width, and returns how much of it it needs (with 0 spacing it would be 477) - The second time the available width it gets is the same as it returned last phase (and probably is expected to return the same result again) The width fit requests is the total width of all widgets together + the spacing (e.g. if each tag widget is 53 px and spacing is -10 then the requested width 53 * 9 - 80). The function tries to first fit all its widgets (the tag numbers) in the amount of width it received, and only then adds the spacing to it. This is problematic because in the second phase the widgets need to fit themselves in the same width they requested earlier minus the spacing (in case of negative spacing). This is of course impossible and so some widgets are just not being drawn correctly. This patch makes fit function take into account the spacing while placing the widgets and not afterwards. Also add unit-testing that test the bug described. Signed-off-by: Shay Agroskin <agrosshay@gmail.com> |
||
---|---|---|
.. | ||
align.lua | ||
constraint.lua | ||
fixed.lua | ||
flex.lua | ||
grid.lua | ||
init.lua | ||
manual.lua | ||
margin.lua | ||
mirror.lua | ||
ratio.lua | ||
rotate.lua | ||
scroll.lua | ||
stack.lua |