From de42e1b500d6c1f03a3d7ff061849a848b126176 Mon Sep 17 00:00:00 2001 From: MondoBoricua Date: Wed, 15 Apr 2026 14:41:40 -0400 Subject: [PATCH] Fix DisplayProgressBar horizontal bar filling wrong side MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The refactor in db59686 ("refactor code, inverse now a graph setting") introduced shared x1/y1/x2/y2 defaults and assigned the wrong coordinate in the horizontal non-reverse branch: x1 was set to bar_filled_width instead of x2, which caused the bar to render the empty portion in BAR_COLOR and the filled portion in BACKGROUND_COLOR. Pre-refactor code drew [0, 0, bar_filled_width, height - 1] — i.e. x2 was the variable, not x1. Restoring that behavior fixes the inversion while leaving the reverse_direction and vertical branches unchanged (those were already correct after the refactor). Fixes #982 --- library/lcd/lcd_comm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/lcd/lcd_comm.py b/library/lcd/lcd_comm.py index ee6bd293..5b702772 100644 --- a/library/lcd/lcd_comm.py +++ b/library/lcd/lcd_comm.py @@ -378,7 +378,7 @@ def DisplayProgressBar(self, x: int, y: int, width: int, height: int, min_value: if reverse_direction is True: x1 = width - bar_filled_width else: - x1 = bar_filled_width + x2 = bar_filled_width else: if reverse_direction is True: y2 = height - bar_filled_height