Skip to content

Added Fixed Position Parameter to Make Compatible with CP4 Beta 5 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion adafruit_display_shapes/rect.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ def __init__(self, x, y, width, height, *, fill=None, outline=None, stroke=1):
self._palette[0] = fill
else:
self._palette.make_transparent(0)
super().__init__(self._bitmap, pixel_shader=self._palette, position=(x, y))
try:
super().__init__(self._bitmap, pixel_shader=self._palette, position=(x, y))
except TypeError:
super().__init__(self._bitmap, pixel_shader=self._palette, x=x, y=y)

@property
def fill(self):
Expand Down
5 changes: 4 additions & 1 deletion adafruit_display_shapes/roundrect.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ def __init__(self, x, y, width, height, r, *, fill=None, outline=None, stroke=1)
# draw round corners
self._helper(r, r, r, color=1, stroke=stroke,
x_offset=width-2*r-1, y_offset=height-2*r-1)
super().__init__(self._bitmap, pixel_shader=self._palette, position=(x, y))
try:
super().__init__(self._bitmap, pixel_shader=self._palette, position=(x, y))
except TypeError:
super().__init__(self._bitmap, pixel_shader=self._palette, x=x, y=y)

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