Skip to content

Commit de7ab83

Browse files
authored
Fix empty input string for MeasureTextEx (#4448)
1 parent f59e185 commit de7ab83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rtext.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing
13271327

13281328
if (tempTextWidth < textWidth) tempTextWidth = textWidth;
13291329

1330-
textSize.x = tempTextWidth*scaleFactor + (float)((tempByteCounter - 1)*spacing);
1330+
if (size > 0) textSize.x = tempTextWidth*scaleFactor + (float)((tempByteCounter - 1)*spacing);
13311331
textSize.y = textHeight;
13321332

13331333
return textSize;

0 commit comments

Comments
 (0)