Adjust child positions on List reload

This commit is contained in:
Gabriel Tofvesson 2024-10-04 01:12:30 +02:00
parent 35db4aa970
commit e985bcba63

View File

@ -24,9 +24,6 @@ function List:insertChild(child, atIndex)
-- Update window references
self:_reload()
-- Update render positions
adjustPositions(self.children, self:isVertical(), index)
end
function List:removeChild(child)
@ -57,9 +54,6 @@ function List:removeChild(child)
local removed = table.remove(self.children, index)
self:_reload()
if index <= #self.children then
adjustPositions(self.children, self:isVertical(), index)
end
return true, removed
end
@ -137,6 +131,8 @@ function List:_reload()
child:setParent(win)
end
end
adjustPositions(self.children, self:isVertical(), 1)
end
return List