From b085954ce5262b4f76e662f94606e56ec9e6c116 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Fri, 22 Mar 2019 22:09:57 -0700 Subject: [PATCH] Fixed Position Parameter --- adafruit_display_shapes/rect.py | 5 ++++- adafruit_display_shapes/roundrect.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) mode change 100644 => 100755 adafruit_display_shapes/rect.py mode change 100644 => 100755 adafruit_display_shapes/roundrect.py diff --git a/adafruit_display_shapes/rect.py b/adafruit_display_shapes/rect.py old mode 100644 new mode 100755 index 951552a..f68debc --- a/adafruit_display_shapes/rect.py +++ b/adafruit_display_shapes/rect.py @@ -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): diff --git a/adafruit_display_shapes/roundrect.py b/adafruit_display_shapes/roundrect.py old mode 100644 new mode 100755 index 9c3c4d6..0d51be0 --- a/adafruit_display_shapes/roundrect.py +++ b/adafruit_display_shapes/roundrect.py @@ -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,