From dc5a9b18df36540efbdbffbf50edd2cf284c107f Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Sun, 2 Jun 2024 20:00:57 +0200 Subject: [PATCH] Fix visibility setting in listframes redraw, remove debug logging --- listframes.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/listframes.lua b/listframes.lua index b26f68d..3f09e21 100644 --- a/listframes.lua +++ b/listframes.lua @@ -3,7 +3,6 @@ local subFrames = {} local length = 0 local frame = term.current() local drawEntry = nil -local debugLog = fs.open("listframes.debug", "w") -- pagination start line (not number of entries!) local paginationPos = 1 @@ -59,10 +58,7 @@ local function redrawEntry(idx) local tw, th = frame.getSize() local xPos, yPos = entryFrame.getPosition() local xSize, ySize = entryFrame.getSize() - local visible = (yPos+ySize-1) >= paginationPos and yPos <= th - debugLog.writeLine(string.format("[redrawEntry] idx=%d, yPos=%d, visible=%s", idx, yPos, tostring(visible))) - debugLog.flush() - entryFrame.setVisible(visible) + entryFrame.setVisible((yPos + ySize) > 1 and yPos <= th) end end