Skip to content

Commit de42e1b

Browse files
committed
Fix DisplayProgressBar horizontal bar filling wrong side
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
1 parent fcf0b38 commit de42e1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/lcd/lcd_comm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def DisplayProgressBar(self, x: int, y: int, width: int, height: int, min_value:
378378
if reverse_direction is True:
379379
x1 = width - bar_filled_width
380380
else:
381-
x1 = bar_filled_width
381+
x2 = bar_filled_width
382382
else:
383383
if reverse_direction is True:
384384
y2 = height - bar_filled_height

0 commit comments

Comments
 (0)