]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/blobdiff - displayio/display.py
Merge pull request #15 from makermelissa/fix-hx8357
[hackapet/Adafruit_Blinka_Displayio.git] / displayio / display.py
index 6bc50397fe1882f737bdc97757bffe37ad581ede..904302b7688c0ba0905ae09c95d371f4ff49d0a6 100644 (file)
@@ -21,7 +21,7 @@
 # THE SOFTWARE.
 
 """
-`displayio`
+`displayio.display`
 ================================================================================
 
 displayio for Blinka
@@ -40,12 +40,14 @@ import struct
 import threading
 from PIL import Image
 import numpy
-from displayio import Rectangle
-from displayio import displays
+from recordclass import recordclass
 
 __version__ = "0.0.0-auto.0"
 __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git"
 
+Rectangle = recordclass("Rectangle", "x1 y1 x2 y2")
+displays = []
+
 # pylint: disable=unnecessary-pass, unused-argument
 
 # pylint: disable=too-many-instance-attributes
@@ -202,7 +204,7 @@ class Display:
             self._current_group._fill_area(buffer)  # pylint: disable=protected-access
             # save image to buffer (or probably refresh buffer so we can compare)
             self._buffer.paste(buffer)
-        time.sleep(1)
+
         # Eventually calculate dirty rectangles here
         self._subrectangles.append(Rectangle(0, 0, self._width, self._height))
 
@@ -229,13 +231,13 @@ class Display:
         self._write(
             self._set_column_command,
             self._encode_pos(
-                rectangle.x1 + self._colstart, rectangle.x2 + self._colstart
+                rectangle.x1 + self._colstart, rectangle.x2 + self._colstart - 1
             ),
         )
         self._write(
             self._set_row_command,
             self._encode_pos(
-                rectangle.y1 + self._rowstart, rectangle.y2 + self._rowstart
+                rectangle.y1 + self._rowstart, rectangle.y2 + self._rowstart - 1
             ),
         )
         self._write(self._write_ram_command, pixels)