diff --git a/gfx/list.lua b/gfx/list.lua index f8084d4..f8c46aa 100644 --- a/gfx/list.lua +++ b/gfx/list.lua @@ -5,15 +5,15 @@ local List = Element:new{ } local function adjustPositions(elements, vertical, from) - local newDims = 0 + local newDims = 1 local getDim = vertical and function(e) return e:getHeight() end or function(e) return e:getWidth() end for i=1,from-1 do newDims = newDims + getDim(elements[i]) end - local setDim = vertical and function(e, dim) e:setPos(0, dim) end or function(e, dim) e:setPos(dim, 0) end + local setDim = vertical and function(e, dim) e:setPos(1, dim) end or function(e, dim) e:setPos(dim, 1) end for i=from,#elements do - setDim(elements[i]) + setDim(elements[i], newDims) newDims = newDims + getDim(elements[i]) end end