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