Fix visibility setting in listframes redraw, remove debug logging

This commit is contained in:
Ben 2024-06-02 20:00:57 +02:00
parent 4f001f5053
commit dc5a9b18df
Signed by: ben
GPG key ID: 0F54A7ED232D3319

View file

@ -3,7 +3,6 @@ local subFrames = {}
local length = 0 local length = 0
local frame = term.current() local frame = term.current()
local drawEntry = nil local drawEntry = nil
local debugLog = fs.open("listframes.debug", "w")
-- pagination start line (not number of entries!) -- pagination start line (not number of entries!)
local paginationPos = 1 local paginationPos = 1
@ -59,10 +58,7 @@ local function redrawEntry(idx)
local tw, th = frame.getSize() local tw, th = frame.getSize()
local xPos, yPos = entryFrame.getPosition() local xPos, yPos = entryFrame.getPosition()
local xSize, ySize = entryFrame.getSize() local xSize, ySize = entryFrame.getSize()
local visible = (yPos+ySize-1) >= paginationPos and yPos <= th entryFrame.setVisible((yPos + ySize) > 1 and yPos <= th)
debugLog.writeLine(string.format("[redrawEntry] idx=%d, yPos=%d, visible=%s", idx, yPos, tostring(visible)))
debugLog.flush()
entryFrame.setVisible(visible)
end end
end end