Skip to content

Commit 5043a09

Browse files
authored
Update to fill/outline color check
The current code doesn't draw the button if both fill and outline are 0x000000 (black). With the proposed change, if either the outline or the fill have been assigned any value, the check will pass. If fill and outline are both None, nothing will be drawn.
1 parent dc7ef5d commit 5043a09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_button.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ def __init__(self, *, x, y, width, height, name=None, style=RECT,
111111
self.selected_fill = (~self.fill_color) & 0xFFFFFF
112112
if self.selected_outline is None and outline_color is not None:
113113
self.selected_outline = (~self.outline_color) & 0xFFFFFF
114-
115-
if outline_color or fill_color:
114+
115+
if (outline_color is not None) or (fill_color is not None):
116116
if style == Button.RECT:
117117
self.body = Rect(x, y, width, height,
118118
fill=self.fill_color, outline=self.outline_color)

0 commit comments

Comments
 (0)