diff options
| author | Marrony Neris <[email protected]> | 2024-02-01 12:14:22 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-02-01 21:14:22 +0100 |
| commit | c0b081fac042ebc5d31d99887faaf27806a4e80b (patch) | |
| tree | 7d3dea8022c853fdee5a24a967d4b7e5d3ee5947 /src | |
| parent | 25306eae4212f3e7b239aabad3316eb4eba8df56 (diff) | |
| download | raylib-c0b081fac042ebc5d31d99887faaf27806a4e80b.tar.gz raylib-c0b081fac042ebc5d31d99887faaf27806a4e80b.zip | |
Fix MeasureTextEx() height calculation (#3770)
Diffstat (limited to 'src')
| -rw-r--r-- | src/rtext.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rtext.c b/src/rtext.c index 7835ff80..22c2e5e4 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; } |
