Skip to content

Commit b085954

Browse files
author
Melissa LeBlanc-Williams
committed
Fixed Position Parameter
1 parent bb59442 commit b085954

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

adafruit_display_shapes/rect.py

100644100755
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ def __init__(self, x, y, width, height, *, fill=None, outline=None, stroke=1):
7878
self._palette[0] = fill
7979
else:
8080
self._palette.make_transparent(0)
81-
super().__init__(self._bitmap, pixel_shader=self._palette, position=(x, y))
81+
try:
82+
super().__init__(self._bitmap, pixel_shader=self._palette, position=(x, y))
83+
except TypeError:
84+
super().__init__(self._bitmap, pixel_shader=self._palette, x=x, y=y)
8285

8386
@property
8487
def fill(self):

adafruit_display_shapes/roundrect.py

100644100755
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ def __init__(self, x, y, width, height, r, *, fill=None, outline=None, stroke=1)
9090
# draw round corners
9191
self._helper(r, r, r, color=1, stroke=stroke,
9292
x_offset=width-2*r-1, y_offset=height-2*r-1)
93-
super().__init__(self._bitmap, pixel_shader=self._palette, position=(x, y))
93+
try:
94+
super().__init__(self._bitmap, pixel_shader=self._palette, position=(x, y))
95+
except TypeError:
96+
super().__init__(self._bitmap, pixel_shader=self._palette, x=x, y=y)
9497

9598
# pylint: disable=invalid-name, too-many-locals, too-many-branches
9699
def _helper(self, x0, y0, r, *, color, x_offset=0, y_offset=0,

0 commit comments

Comments
 (0)