Skip to content

Commit d1bbc7f

Browse files
committed
Made matrix scrolling smoother
1 parent 92d26c7 commit d1bbc7f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

adafruit_ht16k33/matrix.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ def shift(self, x, y, rotate=False):
5959
6060
:param rotate: (Optional) Rotate the shifted pixels to the left side (default=False)
6161
"""
62+
auto_write = self.auto_write
63+
self._auto_write = False
6264
if x > 0: # Shift Right
6365
for _ in range(x):
6466
for row in range(0, self.rows):
@@ -87,7 +89,8 @@ def shift(self, x, y, rotate=False):
8789
for row in range(0, self.rows - 1):
8890
self[col, row] = self[col, row + 1]
8991
self[col, self.rows - 1] = last_pixel
90-
if self._auto_write:
92+
self._auto_write = auto_write
93+
if auto_write:
9194
self.show()
9295
#pylint: enable=too-many-branches
9396

0 commit comments

Comments
 (0)