From 5043a0956013b024a5e76c1f71e56043cbb55005 Mon Sep 17 00:00:00 2001 From: Jason Pecor <14111408+jpecor@users.noreply.github.com> Date: Mon, 12 Aug 2019 22:24:41 -0500 Subject: [PATCH 1/2] 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. --- adafruit_button.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_button.py b/adafruit_button.py index 32cc0b9..ba4f76e 100755 --- a/adafruit_button.py +++ b/adafruit_button.py @@ -111,8 +111,8 @@ def __init__(self, *, x, y, width, height, name=None, style=RECT, self.selected_fill = (~self.fill_color) & 0xFFFFFF if self.selected_outline is None and outline_color is not None: self.selected_outline = (~self.outline_color) & 0xFFFFFF - - if outline_color or fill_color: + + if (outline_color is not None) or (fill_color is not None): if style == Button.RECT: self.body = Rect(x, y, width, height, fill=self.fill_color, outline=self.outline_color) From d329cd4bdeb14467551f43a743eaeb21bb52e483 Mon Sep 17 00:00:00 2001 From: Jason Pecor <14111408+jpecor@users.noreply.github.com> Date: Tue, 13 Aug 2019 13:12:28 -0500 Subject: [PATCH 2/2] Update adafruit_button.py Removed extra spaces on line 114 --- adafruit_button.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_button.py b/adafruit_button.py index ba4f76e..f9d84ba 100755 --- a/adafruit_button.py +++ b/adafruit_button.py @@ -111,7 +111,7 @@ def __init__(self, *, x, y, width, height, name=None, style=RECT, self.selected_fill = (~self.fill_color) & 0xFFFFFF if self.selected_outline is None and outline_color is not None: self.selected_outline = (~self.outline_color) & 0xFFFFFF - + if (outline_color is not None) or (fill_color is not None): if style == Button.RECT: self.body = Rect(x, y, width, height,