From 43a8cc20b58681ca8671f50c9a50eed8a779af29 Mon Sep 17 00:00:00 2001 From: jussi Date: Mon, 17 Jun 2024 12:37:38 +0300 Subject: Added missing line break for DrawTextBoxed. --- src/text.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/text.c b/src/text.c index 20092d8..d8d1bbd 100644 --- a/src/text.c +++ b/src/text.c @@ -48,7 +48,11 @@ float spacing, bool wordWrap, Color tint, Vector2* textOffset, bool getMouseChar ? (float)font.recs[ index ].width * scaleFactor + spacing : (float)font.glyphs[ index ].advanceX * scaleFactor + spacing; - if ( wordWrap && ( wordWidth < rec.width ) ) { + if ( codepoint == '\n' ) { + textOffset->x = 0; + textOffset->y += lineSpacing; + } + else if ( wordWrap && ( wordWidth < rec.width ) ) { if ( measure && codepoint != ' ' ) { wordWidth = measureWord( font, &text[i], fontSize, spacing ); measure = false; -- cgit v1.2.3