From bb195b17e216a94506ba97e33656fb50f77670c7 Mon Sep 17 00:00:00 2001 From: kenjiqq <599468+kenjiqq@users.noreply.github.com> Date: Sun, 18 Feb 2024 02:21:17 +0100 Subject: [PATCH] fix padding calculation for column annotations with newlines --- src/utils/images_grid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/images_grid.py b/src/utils/images_grid.py index 6a09787..a350c89 100644 --- a/src/utils/images_grid.py +++ b/src/utils/images_grid.py @@ -109,7 +109,7 @@ def _create_grid_annotation( + font.getlength(WIDEST_LETTER)*2 ) if column_texts: - top_padding = int(font.size * 2) + top_padding = max(col_text.count('\n') for col_text in column_texts) * int(font.size) + int(font.size * 2) image = Image.new( "RGB",