diff --git a/adafruit_display_shapes/rect.py b/adafruit_display_shapes/rect.py index 951552a..0ea637a 100644 --- a/adafruit_display_shapes/rect.py +++ b/adafruit_display_shapes/rect.py @@ -78,7 +78,7 @@ 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)) + super().__init__(self._bitmap, pixel_shader=self._palette, x=x, y=y) @property def fill(self): @@ -105,23 +105,3 @@ def outline(self, color): self._palette.make_transparent(1) else: self._palette[1] = color - - @property - def x(self): - """The x coordinate of the position""" - return self.position[0] - - @x.setter - def x(self, x): - # pylint: disable=attribute-defined-outside-init - self.position = (x, self.position[1]) - - @property - def y(self): - """The y coordinate of the position""" - return self.position[1] - - @y.setter - def y(self, y): - # pylint: disable=attribute-defined-outside-init - self.position = (self.position[0], y) diff --git a/adafruit_display_shapes/roundrect.py b/adafruit_display_shapes/roundrect.py index 9c3c4d6..1b4402b 100644 --- a/adafruit_display_shapes/roundrect.py +++ b/adafruit_display_shapes/roundrect.py @@ -90,7 +90,7 @@ 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)) + 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, @@ -164,24 +164,3 @@ def outline(self, color): self._palette.make_transparent(1) else: self._palette[1] = color - - - @property - def x(self): - """The x coordinate of the position""" - return self.position[0] - - @x.setter - def x(self, x): - # pylint: disable=attribute-defined-outside-init - self.position = (x, self.position[1]) - - @property - def y(self): - """The y coordinate of the position""" - return self.position[1] - - @y.setter - def y(self, y): - # pylint: disable=attribute-defined-outside-init - self.position = (self.position[0], y) diff --git a/examples/display_shapes_simpletest.py b/examples/display_shapes_simpletest.py index 545a411..e8021eb 100644 --- a/examples/display_shapes_simpletest.py +++ b/examples/display_shapes_simpletest.py @@ -12,10 +12,8 @@ color_bitmap = displayio.Bitmap(320, 240, 1) color_palette = displayio.Palette(1) color_palette[0] = 0xFFFFFF -bg_sprite = displayio.TileGrid(color_bitmap, - pixel_shader=color_palette, - position=(0, 0)) -print(bg_sprite.position) +bg_sprite = displayio.TileGrid(color_bitmap, x=0, y=0, + pixel_shader=color_palette) splash.append(bg_sprite) ##########################################################################