From 53d60f4a6d05b2b0f8a52e890528d299ddca8454 Mon Sep 17 00:00:00 2001 From: LordBaryhobal Date: Sat, 29 Nov 2025 14:45:41 +0100 Subject: [PATCH] fix: correct progress bar width --- src/lib/progress.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/progress.lua b/src/lib/progress.lua index 6bde1cc..2341d5b 100644 --- a/src/lib/progress.lua +++ b/src/lib/progress.lua @@ -5,7 +5,9 @@ function progress.bar(x, y, width, value, max, fg, bg) local fgWidth = utils.round(value * width / max) fgWidth = math.max(0, math.min(width, fgWidth)) paintutils.drawLine(x, y, x + width - 1, y, bg) - paintutils.drawLine(x, y, x + fgWidth - 1, y, fg) + if fgWidth > 0 then + paintutils.drawLine(x, y, x + fgWidth - 1, y, fg) + end term.setBackgroundColor(colors.black) end