From e0479e9ecf90b6507e2722f59582acc4cdeed9fb Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 9 Nov 2024 16:56:23 +0100 Subject: [PATCH] fixed screen width calculation for level story title --- src/screens.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/screens.c b/src/screens.c index 688c07a0..25f17794 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1763,7 +1763,8 @@ static void DrawInfoScreen_Headline(int screen_nr, int num_screens, use_global_screens ? "for %s" : "for \"%s\""); int text_format_len = strlen(text_format) - strlen("%s"); int text_font = (info_mode == INFO_MODE_STORY ? FONT_TITLE_STORY : FONT_TITLE_2); - int max_text_len = SXSIZE / getFontWidth(text_font); + int max_text_width = SXSIZE - MENU_SCREEN_INFO_SPACE_LEFT - MENU_SCREEN_INFO_SPACE_RIGHT; + int max_text_len = max_text_width / getFontWidth(text_font); int max_name_len = max_text_len - text_format_len; char name_cut[max_name_len]; char *name_full = (info_mode == INFO_MODE_STORY ? level.name_native : -- 2.34.1