fixup! [listframes] cache estimatedTotalHeight

This commit is contained in:
Ben 2024-06-02 20:48:00 +02:00
parent 9c8d245156
commit 6a39e621c4
Signed by: ben
GPG key ID: 0F54A7ED232D3319

View file

@ -61,6 +61,7 @@ local function redrawEntry(idx)
local xSize, ySize = entryFrame.getSize()
local yEnd = yPos+ySize-1
entryFrame.setVisible(yEnd > 0 and yPos <= th)
yEnd = yEnd+paginationPos-1
if yEnd > estimatedTotalHeight then
estimatedTotalHeight = yEnd
end
@ -154,7 +155,7 @@ local function estimatedHeight()
if lastEntryFrame ~= nil and lastEntryFrame.isVisible() then
local xPos, yPos = lastEntryFrame.getPosition()
local xSize, ySize = lastEntryFrame.getSize()
estimatedTotalHeight = yPos+ySize-1
estimatedTotalHeight = yPos+ySize-1+paginationPos-1
end
return estimatedTotalHeight
end