Merge pull request #2222 from adafruit/jepler-patch-1
Don't use "bitmap" property of TileGrid objects
This commit is contained in:
commit
51d59669ac
1 changed files with 3 additions and 3 deletions
|
|
@ -36,15 +36,15 @@ for i, pi in enumerate((0xff0000, 0xff0a00, 0xff1400, 0xff1e00,
|
||||||
class RollingGraph(displayio.TileGrid):
|
class RollingGraph(displayio.TileGrid):
|
||||||
def __init__(self, scale=2):
|
def __init__(self, scale=2):
|
||||||
# Create a bitmap with heatmap colors
|
# Create a bitmap with heatmap colors
|
||||||
self.bitmap = displayio.Bitmap(display.width//scale,
|
self._bitmap = displayio.Bitmap(display.width//scale,
|
||||||
display.height//scale, len(palette))
|
display.height//scale, len(palette))
|
||||||
super().__init__(self.bitmap, pixel_shader=palette)
|
super().__init__(self._bitmap, pixel_shader=palette)
|
||||||
|
|
||||||
self.scroll_offset = 0
|
self.scroll_offset = 0
|
||||||
|
|
||||||
def show(self, data):
|
def show(self, data):
|
||||||
y = self.scroll_offset
|
y = self.scroll_offset
|
||||||
bitmap = self.bitmap
|
bitmap = self._bitmap
|
||||||
|
|
||||||
board.DISPLAY.auto_refresh = False
|
board.DISPLAY.auto_refresh = False
|
||||||
offset = max(0, (bitmap.width-len(data))//2)
|
offset = max(0, (bitmap.width-len(data))//2)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue