X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/blobdiff_plain/03b2e1008f33585652fad5ecedad65d44694b2bc..ec2857d4ecd1d5258fb00c6d8931d0267c190eee:/displayio/_display.py?ds=inline diff --git a/displayio/_display.py b/displayio/_display.py index 8038722..1e42995 100644 --- a/displayio/_display.py +++ b/displayio/_display.py @@ -26,7 +26,7 @@ import digitalio from PIL import Image import numpy import microcontroller -import _typing +import circuitpython_typing from ._displaycore import _DisplayCore from ._displaybus import _DisplayBus from ._colorconverter import ColorConverter @@ -41,7 +41,7 @@ from ._constants import ( BACKLIGHT_PWM, ) -__version__ = "0.0.0-auto.0" +__version__ = "0.0.0+auto.0" __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git" displays = [] @@ -60,7 +60,7 @@ class Display: def __init__( self, display_bus: _DisplayBus, - init_sequence: _typing.ReadableBuffer, + init_sequence: circuitpython_typing.ReadableBuffer, *, width: int, height: int, @@ -272,6 +272,11 @@ class Display: ) # pylint: disable=protected-access # save image to buffer (or probably refresh buffer so we can compare) self._buffer.paste(buffer) + else: + # show nothing + print("show nothing") + buffer = Image.new("RGBA", (self._core._width, self._core._height)) + self._buffer.paste(buffer) self._subrectangles = self._core.get_refresh_areas() @@ -289,7 +294,7 @@ class Display: def _refresh_display_area(self, rectangle): """Loop through dirty rectangles and redraw that area.""" img = self._buffer.convert("RGB").crop(astuple(rectangle)) - img = img.rotate(self._rotation, expand=True) + img = img.rotate(360 - self._rotation, expand=True) display_rectangle = self._apply_rotation(rectangle) img = img.crop(astuple(self._clip(display_rectangle))) @@ -367,8 +372,8 @@ class Display: return struct.pack(self._bounds_encoding, x, y) # pylint: disable=no-member def fill_row( - self, y: int, buffer: _typing.WriteableBuffer - ) -> _typing.WriteableBuffer: + self, y: int, buffer: circuitpython_typing.WriteableBuffer + ) -> circuitpython_typing.WriteableBuffer: """Extract the pixels from a single row""" for x in range(0, self._width): _rgb_565 = self._colorconverter.convert(self._buffer.getpixel((x, y))) @@ -452,3 +457,11 @@ class Display: def bus(self) -> _DisplayBus: """Current Display Bus""" return self._core.get_bus() + + @property + def root_group(self) -> Group: + return self._current_group + + @root_group.setter + def root_group(self, new_group): + self._current_group = new_group \ No newline at end of file