]> Repositories - hackapet/Adafruit_Blinka_Displayio.git/commitdiff
trying to implement fill_row function
authorFoamyGuy <foamyguy@gmail.com>
Fri, 3 Jul 2020 13:44:52 +0000 (08:44 -0500)
committerFoamyGuy <foamyguy@gmail.com>
Fri, 3 Jul 2020 13:44:52 +0000 (08:44 -0500)
displayio/display.py

index 3f9317767994ab0a700e937f585238ca2d0ec73c..4fc2bf7726e3d48d0b4fbddd1f55b33a8b738b8c 100644 (file)
@@ -341,8 +341,8 @@ class Display:
         """Extract the pixels from a single row"""
         for x in range(0, self._width):
             _rgb_565 = self._rgb_tuple_to_rgb565(self._buffer.getpixel((x, y)))
-            buffer[x * 2] = _rgb_565 >> 8
-            buffer[x * 2 + 1] = _rgb_565
+            buffer[x * 2] = (_rgb_565 >> 8) & 0xff
+            buffer[x * 2 + 1] = _rgb_565 & 0xff
             #(data[i * 2] << 8) + data[i * 2 + 1]
         return buffer