X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/blobdiff_plain/4ce6ccfe5fdee154abaa19bcdbdc1560b8cf43a0..7c8fcb8b324e839a65d45174da42bf9a7ab1a217:/displayio/_display.py diff --git a/displayio/_display.py b/displayio/_display.py index d7d04cf..3f6d7b6 100644 --- a/displayio/_display.py +++ b/displayio/_display.py @@ -328,7 +328,6 @@ class Display: def _refresh_area(self, area) -> bool: """Loop through dirty areas and redraw that area.""" # pylint: disable=too-many-locals - buffer_size = 128 clipped = Area() # Clip the area to the display by overlapping the areas. @@ -340,6 +339,9 @@ class Display: pixels_per_word = 32 // self._core.colorspace.depth pixels_per_buffer = clipped.size() + # We should have lots of memory + buffer_size = clipped.size() // pixels_per_word + subrectangles = 1 # for SH1107 and other boundary constrained controllers # write one single row at a time @@ -458,7 +460,7 @@ class Display: self._core.send( DISPLAY_COMMAND, CHIP_SELECT_TOGGLE_EVERY_BYTE, - bytes([self._brightness_command, 0xFF * value]), + bytes([self._brightness_command, round(0xFF * value)]), ) else: self._core.send(