Skip to content

Commit 0728206

Browse files
committed
fix none-8-bit boundary sizes
1 parent 4f9b90c commit 0728206

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_epd/epd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def __init__(self, width, height, spi, cs_pin, dc_pin, sramcs_pin, rst_pin, busy
7474
self.sram = mcp_sram.Adafruit_MCP_SRAM(sramcs_pin, spi)
7575
else:
7676
self.sram = None
77-
self._bw_buffer = bytearray((width // 8) * height)
78-
self._red_buffer = bytearray((width // 8) * height)
77+
self._bw_buffer = bytearray((width * height) // 8)
78+
self._red_buffer = bytearray((width * height) // 8)
7979
# since we have *two* framebuffers - one for red and one for black, we dont subclass but manage manually
8080
self._red_framebuf = adafruit_framebuf.FrameBuffer(self._red_buffer, width, height, buf_format=adafruit_framebuf.MHMSB)
8181
self._bw_framebuf = adafruit_framebuf.FrameBuffer(self._bw_buffer, width, height, buf_format=adafruit_framebuf.MHMSB)

0 commit comments

Comments
 (0)