From 96281f0034eb649f0286d37bb4538d2b21202b94 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 31 Oct 2024 00:18:55 +0100 Subject: [PATCH] fixed checking and setting text cut size for getting wrapped text --- src/libgame/text.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libgame/text.c b/src/libgame/text.c index 2281a31d..d7f1dff6 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -590,13 +590,13 @@ static struct WrappedTextInfo *GetWrappedText(char *text_buffer, int base_font_n // limit line buffer length to maximum output line size line_length = MIN(line_length, MAX_OUTPUT_LINESIZE); - // if number of characters where to cut line not defined, set to default line size + // if length where to cut line not defined, set to maximum (to ignore for all font sizes) if (cut_length == -1) - cut_length = line_length; + cut_length = MAX_OUTPUT_LINESIZE; - // if pixel width where to cut line not defined, set from number of characters + // if pixel width where to cut line not defined, set to maximum (to ignore for all font sizes) if (cut_width == -1) - cut_width = cut_length * font_width; + cut_width = line_width; wrapped_text = checked_calloc(sizeof(struct WrappedTextInfo)); wrapped_text->line_width = line_width; -- 2.34.1