From d0c8d867abad1d0ca042870d2b4eea888a790395 Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Sun, 2 Jun 2024 19:13:22 +0200 Subject: [PATCH] Fix estimatedHeight calculation in listframes --- listframes.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/listframes.lua b/listframes.lua index caef743..58b183b 100644 --- a/listframes.lua +++ b/listframes.lua @@ -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