From 147b02aae021da61b1f620446ad2892ecc45411e Mon Sep 17 00:00:00 2001 From: fangrong Date: Wed, 18 Dec 2024 11:14:49 +0800 Subject: [PATCH] Fix text width calculate for 'C2D_TextFontParseLine' --- source/text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/text.c b/source/text.c index 332ec44..ab419ff 100644 --- a/source/text.c +++ b/source/text.c @@ -192,7 +192,7 @@ const char* C2D_TextFontParseLine(C2D_Text* text, C2D_Font font, C2D_TextBuf buf wordNum++; text->end = buf->glyphCount; - text->width *= s_textScale; + text->width *= font ? font->textScale : s_textScale; text->lines = 1; text->words = wordNum; return (const char*)p;