summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjussi2024-06-17 12:37:38 +0300
committerjussi2024-06-17 12:37:38 +0300
commit43a8cc20b58681ca8671f50c9a50eed8a779af29 (patch)
tree9aad7151b0fdc0cbab53a7769a820249169d1d3f
parentd3e184220374c222a02b04d4d57d755b4b6fb782 (diff)
downloadreilua-enhanced-43a8cc20b58681ca8671f50c9a50eed8a779af29.tar.gz
reilua-enhanced-43a8cc20b58681ca8671f50c9a50eed8a779af29.tar.bz2
reilua-enhanced-43a8cc20b58681ca8671f50c9a50eed8a779af29.zip
Added missing line break for DrawTextBoxed.
-rw-r--r--changelog2
-rw-r--r--src/text.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/changelog b/changelog
index 183f18e..e41224a 100644
--- a/changelog
+++ b/changelog
@@ -55,7 +55,7 @@ DETAILED CHANGES:
- ADDED: Unload functions clear object to 0 so they would not be ready in Is*Ready.
- CHANGE: DrawTextBoxed uses lineSpacing.
- ADDED: GetTextLineSpacing.
- - REMOVED: DrawTextBoxedTinted. DrawTextBoxedEx can do same with much more efficiently.
+ - REMOVED: DrawTextBoxedTinted. DrawTextBoxedEx can do same much more efficiently.
- ADDED: DrawTextBoxedEx.
------------------------------------------------------------------------
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;