Skip to content

Commit c0b081f

Browse files
authored
Fix MeasureTextEx() height calculation (#3770)
1 parent 25306ea commit c0b081f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rtext.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1257,7 +1257,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing
12571257
float textWidth = 0.0f;
12581258
float tempTextWidth = 0.0f; // Used to count longer text line width
12591259

1260-
float textHeight = (float)font.baseSize;
1260+
float textHeight = fontSize;
12611261
float scaleFactor = fontSize/(float)font.baseSize;
12621262

12631263
int letter = 0; // Current character
@@ -1294,7 +1294,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing
12941294
if (tempTextWidth < textWidth) tempTextWidth = textWidth;
12951295

12961296
textSize.x = tempTextWidth*scaleFactor + (float)((tempByteCounter - 1)*spacing);
1297-
textSize.y = textHeight*scaleFactor;
1297+
textSize.y = textHeight;
12981298

12991299
return textSize;
13001300
}

0 commit comments

Comments
 (0)