Simplify initializing glyph_data (#1970)

Make it easier to read the initialization with zeros, no loop required.
This commit is contained in:
Frederik Gladhorn 2021-06-30 20:36:48 +02:00 committed by GitHub
parent 964ab65497
commit d604321f37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -110,7 +110,7 @@ async def to_code(config):
_, (offset_x, offset_y) = font.font.getsize(glyph)
width, height = mask.size
width8 = ((width + 7) // 8) * 8
glyph_data = [0 for _ in range(height * width8 // 8)] # noqa: F812
glyph_data = [0] * (height * width8 // 8)
for y in range(height):
for x in range(width):
if not mask.getpixel((x, y)):