- def _apply_rotation(self, rectangle):
- """Adjust the rectangle coordinates based on rotation"""
- if self._core.rotation == 90:
- return RectangleStruct(
- self._core.height - rectangle.y2,
- rectangle.x1,
- self._core.height - rectangle.y1,
- rectangle.x2,
- )
- if self._core.rotation == 180:
- return RectangleStruct(
- self._core.width - rectangle.x2,
- self._core.height - rectangle.y2,
- self._core.width - rectangle.x1,
- self._core.height - rectangle.y1,
- )
- if self._core.rotation == 270:
- return RectangleStruct(
- rectangle.y1,
- self._core.width - rectangle.x2,
- rectangle.y2,
- self._core.width - rectangle.x1,
- )
- return rectangle
-
- def fill_row(
- self, y: int, buffer: circuitpython_typing.WriteableBuffer
- ) -> circuitpython_typing.WriteableBuffer: