Skip to content

Commit 0db4dfc

Browse files
committed
turns out you shouldnt set postion=None
1 parent 0238dc2 commit 0db4dfc

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

adafruit_display_shapes/rect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ class Rect(displayio.TileGrid):
5353
def __init__(self, x, y, width, height, *, stroke=1, fill=None, outline=None):
5454
self._bitmap = displayio.Bitmap(width, height, 2)
5555
self._palette = displayio.Palette(2)
56-
self.position = None # this is later set up by super()'s init
5756

5857
if outline is not None:
58+
self._palette[1] = outline
5959
for w in range(width):
6060
for line in range(stroke):
6161
self._bitmap[w, line] = 1
@@ -64,7 +64,7 @@ def __init__(self, x, y, width, height, *, stroke=1, fill=None, outline=None):
6464
for line in range(stroke):
6565
self._bitmap[line, _h] = 1
6666
self._bitmap[width-1-line, _h] = 1
67-
self._palette[1] = outline
67+
6868
if fill is not None:
6969
self._palette[0] = fill
7070
else:

adafruit_display_shapes/roundrect.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ class RoundRect(displayio.TileGrid):
5151
for the color or None for transparent. Outline can be a hex value for the color
5252
or None for no outline."""
5353
def __init__(self, x, y, width, height, r, *, fill=None, outline=None, stroke=1): # pylint: disable=too-many-arguments
54-
self._bitmap = displayio.Bitmap(width, height, 3)
5554
self._palette = displayio.Palette(3)
5655
self._palette.make_transparent(0)
57-
self.position = None # this is reset by the super().init
56+
self._bitmap = displayio.Bitmap(width, height, 3)
5857

5958
if fill is not None:
6059
for i in range(0, width): # draw the center chunk

0 commit comments

Comments
 (0)