mod letter

This commit is contained in:
l.gabrysiak 2025-03-02 16:30:59 +01:00
parent 48de5871e3
commit 010f983531
1 changed files with 3 additions and 3 deletions

View File

@ -395,9 +395,9 @@ class UsersTable:
bbox = font.getbbox(letter) bbox = font.getbbox(letter)
text_width = bbox[2] - bbox[0] text_width = bbox[2] - bbox[0]
text_height = bbox[3] - bbox[1] x = (size[0] - text_width) // 2
position = ((size[0] - text_width) // 2, (size[1] - text_height) // 2) y = (size[1] - bbox[1]) // 2 # Poprawione obliczenie pozycji y
draw.text(position, letter, font=font, fill=text_color) draw.text((x, y), letter, font=font, fill=text_color)
buffered = io.BytesIO() buffered = io.BytesIO()
image.save(buffered, format="PNG") image.save(buffered, format="PNG")