You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you pass something other than 0.0 in the constructor and then do not ever set progress again the bar will not get drawn correctly.
It's due to the newest update that added some efficiency when drawing. So older versions likely did not have this problem.
code to reproduce:
importboardimportdisplayiofromadafruit_progressbarimportProgressBar# Make the display contextgroup=displayio.Group(max_size=2)
board.DISPLAY.show(group)
x=board.DISPLAY.width//5y=board.DISPLAY.height//3progress_bar=ProgressBar(x, y, 200, 30, 0.5)
group.append(progress_bar)
whileTrue:
pass
Instead of the progress bar being drawn half full there is only a single line drawn in the middle.
I think the easiest fix is to change init to use 0.0 first and then set progress afterward.
The previous code produces a correct looking result if you change it like this:
progress_bar=ProgressBar(x, y, 200, 30, 0.0)
progress_bar.progress=0.5
The text was updated successfully, but these errors were encountered:
If you pass something other than
0.0
in the constructor and then do not ever setprogress
again the bar will not get drawn correctly.It's due to the newest update that added some efficiency when drawing. So older versions likely did not have this problem.
code to reproduce:
Instead of the progress bar being drawn half full there is only a single line drawn in the middle.
I think the easiest fix is to change
init
to use0.0
first and then setprogress
afterward.The previous code produces a correct looking result if you change it like this:
The text was updated successfully, but these errors were encountered: