@@ -80,8 +80,8 @@ def __init__(
80
80
self ._palette [1 ] = outline_color
81
81
self ._palette [2 ] = bar_color
82
82
83
- self ._width = width
84
- self ._height = height
83
+ self .width = width
84
+ self .height = height
85
85
86
86
self ._progress_val = 0.0
87
87
self .progress = self ._progress_val
@@ -119,17 +119,17 @@ def progress(self, value):
119
119
if self ._progress_val > value :
120
120
# uncolorize range from width*value+margin to width-margin
121
121
# from right to left
122
- _prev_pixel = max (2 , int (self ._width * self ._progress_val - 2 ))
123
- _new_pixel = max (int (self ._width * value - 2 ), 2 )
122
+ _prev_pixel = max (2 , int (self .width * self ._progress_val - 2 ))
123
+ _new_pixel = max (int (self .width * value - 2 ), 2 )
124
124
for _w in range (_prev_pixel , _new_pixel - 1 , - 1 ):
125
- for _h in range (2 , self ._height - 2 ):
125
+ for _h in range (2 , self .height - 2 ):
126
126
self ._bitmap [_w , _h ] = 0
127
127
else :
128
128
# fill from the previous x pixel to the new x pixel
129
- _prev_pixel = max (2 , int (self ._width * self ._progress_val - 3 ))
130
- _new_pixel = min (int (self ._width * value - 2 ), int (self ._width * 1.0 - 3 ))
129
+ _prev_pixel = max (2 , int (self .width * self ._progress_val - 3 ))
130
+ _new_pixel = min (int (self .width * value - 2 ), int (self .width * 1.0 - 3 ))
131
131
for _w in range (_prev_pixel , _new_pixel + 1 ):
132
- for _h in range (2 , self ._height - 2 ):
132
+ for _h in range (2 , self .height - 2 ):
133
133
self ._bitmap [_w , _h ] = 2
134
134
self ._progress_val = value
135
135
0 commit comments