|
@@ -47,7 +47,9 @@ class Matrix(object):
|
|
|
'''
|
|
'''
|
|
|
if x >= self.width or y >= self.height or x < 0 or y < 0:
|
|
if x >= self.width or y >= self.height or x < 0 or y < 0:
|
|
|
return
|
|
return
|
|
|
- if color == (0, 0, 0) and not self.transparent:
|
|
|
|
|
|
|
+
|
|
|
|
|
+ # [dr]: inverted logic
|
|
|
|
|
+ if color == (0, 0, 0) and self.transparent:
|
|
|
color = (1, 1, 1)
|
|
color = (1, 1, 1)
|
|
|
|
|
|
|
|
offset = (x + y * self.width) * 3 + self._header_len
|
|
offset = (x + y * self.width) * 3 + self._header_len
|
|
@@ -64,6 +66,11 @@ class Matrix(object):
|
|
|
'''Send the updated pixels to the display.'''
|
|
'''Send the updated pixels to the display.'''
|
|
|
self._sock.send(self._data)
|
|
self._sock.send(self._data)
|
|
|
|
|
|
|
|
|
|
+ def clear(self):
|
|
|
|
|
+ '''clear pane with black (reinit self._data)
|
|
|
|
|
+ '''
|
|
|
|
|
+ self._init_data()
|
|
|
|
|
+
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
|
f = Matrix('192.168.178.144', 50, 50)
|
|
f = Matrix('192.168.178.144', 50, 50)
|
|
|
import time
|
|
import time
|