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

View file

@ -110,7 +110,7 @@ async def to_code(config):
_, (offset_x, offset_y) = font.font.getsize(glyph) _, (offset_x, offset_y) = font.font.getsize(glyph)
width, height = mask.size width, height = mask.size
width8 = ((width + 7) // 8) * 8 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 y in range(height):
for x in range(width): for x in range(width):
if not mask.getpixel((x, y)): if not mask.getpixel((x, y)):