@@ -101,7 +101,7 @@ def __init__(
101
101
point_a [1 ] - y0 ,
102
102
point_b [0 ] - min (xs ),
103
103
point_b [1 ] - y0 ,
104
- 1 ,
104
+ self . _OUTLINE ,
105
105
)
106
106
107
107
# pylint: disable=invalid-name, too-many-branches
@@ -126,7 +126,7 @@ def _draw_filled(
126
126
a = x2
127
127
elif x2 > b :
128
128
b = x2
129
- self ._line (a , y0 , b , y0 , 2 )
129
+ self ._line (a , y0 , b , y0 , self . _FILL )
130
130
return
131
131
132
132
if y1 == y2 :
@@ -140,29 +140,29 @@ def _draw_filled(
140
140
b = round (x0 + (x2 - x0 ) * (y - y0 ) / (y2 - y0 ))
141
141
if a > b :
142
142
a , b = b , a
143
- self ._line (a , y , b , y , 2 )
143
+ self ._line (a , y , b , y , self . _FILL )
144
144
# Lower Triangle
145
145
for y in range (last + 1 , y2 + 1 ):
146
146
a = round (x1 + (x2 - x1 ) * (y - y1 ) / (y2 - y1 ))
147
147
b = round (x0 + (x2 - x0 ) * (y - y0 ) / (y2 - y0 ))
148
148
149
149
if a > b :
150
150
a , b = b , a
151
- self ._line (a , y , b , y , 2 )
151
+ self ._line (a , y , b , y , self . _FILL )
152
152
153
153
# pylint: enable=invalid-name, too-many-locals, too-many-branches
154
154
155
155
@property
156
156
def fill (self ) -> Optional [int ]:
157
157
"""The fill of the triangle. Can be a hex value for a color or
158
158
``None`` for transparent."""
159
- return self ._palette [2 ]
159
+ return self ._palette [self . _FILL ]
160
160
161
161
@fill .setter
162
162
def fill (self , color : Optional [int ]) -> None :
163
163
if color is None :
164
- self ._palette [2 ] = 0
165
- self ._palette .make_transparent (2 )
164
+ self ._palette [self . _FILL ] = 0
165
+ self ._palette .make_transparent (self . _FILL )
166
166
else :
167
- self ._palette [2 ] = color
168
- self ._palette .make_opaque (2 )
167
+ self ._palette [self . _FILL ] = color
168
+ self ._palette .make_opaque (self . _FILL )
0 commit comments