Skip to content

Commit 62c8aa4

Browse files
authored
Reinitialize the result_buffer
When using the displayio's `fill_area` function, it does not copy anything for pixels where no Group, TileGrid, or VectorIO is present. In this library, this was causing previous values in the result_buffer to be recopied to the output bitmap file whenever a "un-owned" pixel is observed. This reinitializes the `result_buffer` to be sure that any "un-owned" pixels are made black in the output bitmap file. Resolves issue: #8
1 parent bb18ba2 commit 62c8aa4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

adafruit_bitmapsaver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def _write_pixels(output_file, pixel_source, palette):
9191
color >>= 8
9292
buffer_index += 1
9393
else:
94+
result_buffer = bytearray(2048)
9495
data = pixel_source.fill_row(y - 1, result_buffer)
9596
for i in range(width):
9697
pixel565 = (data[i * 2] << 8) + data[i * 2 + 1]

0 commit comments

Comments
 (0)