X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/blobdiff_plain/ec1fb875ed1cd245f946711e83a1c21f9c4b71d1..f83678c467cb79ddd63f4aa073782f6aa8d428f4:/displayio/_displaycore.py diff --git a/displayio/_displaycore.py b/displayio/_displaycore.py index 76a5d18..207f37a 100644 --- a/displayio/_displaycore.py +++ b/displayio/_displaycore.py @@ -118,16 +118,13 @@ class _DisplayCore: self.rotation = rotation self.transform = TransformStruct() + self.set_rotation(rotation) + def set_rotation(self, rotation: int) -> None: """ Sets the rotation of the display as an int in degrees. """ # pylint: disable=protected-access, too-many-branches - transposed = self.rotation in (90, 270) - will_be_transposed = rotation in (90, 270) - if transposed != will_be_transposed: - self.width, self.height = self.height, self.width - height = self.height width = self.width @@ -176,9 +173,6 @@ class _DisplayCore: self.transform.y = height self.transform.dy = -1 - if self.current_group is not None: - self.current_group._update_transform(self.transform) - def set_root_group(self, root_group: Group) -> bool: """ Switches to displaying the given group of layers. When group is `None`, the @@ -289,7 +283,6 @@ class _DisplayCore: else: region_y1 //= pixels_per_byte * self.colorspace.bytes_per_cell region_y2 //= pixels_per_byte * self.colorspace.bytes_per_cell - region_x2 -= 1 region_y2 -= 1 @@ -343,7 +336,7 @@ class _DisplayCore: if not self.data_as_commands: self.send(DISPLAY_COMMAND, CHIP_SELECT_UNTOUCHED, data) data = bytearray(0) - if self.ram_width < 0x100: # Single Byte Bounds + if self.ram_height < 0x100: # Single Byte Bounds data += struct.pack(">BB", region_y1, region_y2) else: if self.address_little_endian: