Fix estimatedHeight calculation in listframes

This commit is contained in:
Ben 2024-06-02 19:13:22 +02:00
parent af06f11e03
commit d0c8d867ab
Signed by: ben
GPG key ID: 0F54A7ED232D3319

View file

@ -143,11 +143,13 @@ local function updatePage(scrollPos)
end
local function estimatedHeight()
local firstEntryFrame = subFrames[1]
local lastEntryFrame = subFrames[length]
if lastEntryFrame ~= nil then
if firstEntryFrame ~= nil and lastEntryFrame ~= nil then
local firstXPos, firstYPos = firstEntryFrame.getPosition()
local xPos, yPos = lastEntryFrame.getPosition()
local xSize, ySize = lastEntryFrame.getSize()
return yPos+ySize-1
return yPos-firstYPos+ySize
else
return length
end