From bd69975dd8be301ea7748d182427ae0aa446fba1 Mon Sep 17 00:00:00 2001 From: Marrony Neris Date: Wed, 31 Jan 2024 17:36:27 -0800 Subject: [PATCH] Fix MeasureTextEx() height calculation --- src/rtext.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 7835ff80758a..22c2e5e42773 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1257,7 +1257,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing float textWidth = 0.0f; float tempTextWidth = 0.0f; // Used to count longer text line width - float textHeight = (float)font.baseSize; + float textHeight = fontSize; float scaleFactor = fontSize/(float)font.baseSize; int letter = 0; // Current character @@ -1294,7 +1294,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing if (tempTextWidth < textWidth) tempTextWidth = textWidth; textSize.x = tempTextWidth*scaleFactor + (float)((tempByteCounter - 1)*spacing); - textSize.y = textHeight*scaleFactor; + textSize.y = textHeight; return textSize; }