Skip to content

Commit

Permalink
REVIEWED: Issue #3105
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed Jul 2, 2023
1 parent df90da0 commit 48e2663
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/rtext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,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); // Adds chars spacing to measure
textSize.x = (tempTextWidth + (float)((tempByteCounter - 1)*spacing))*scaleFactor;
textSize.y = textHeight*scaleFactor;

return textSize;
Expand Down
3 changes: 1 addition & 2 deletions src/rtextures.c
Original file line number Diff line number Diff line change
Expand Up @@ -3290,8 +3290,7 @@ void ImageDrawText(Image *dst, const char *text, int posX, int posY, int fontSiz
if (GetFontDefault().texture.id == 0) LoadFontDefault();

Vector2 position = { (float)posX, (float)posY };
// NOTE: For default font, spacing is set to desired font size / default font size (10)
ImageDrawTextEx(dst, GetFontDefault(), text, position, (float)fontSize, (float)fontSize/10, color); // WARNING: Module required: rtext
ImageDrawTextEx(dst, GetFontDefault(), text, position, (float)fontSize, 1.0f, color); // WARNING: Module required: rtext
#else
TRACELOG(LOG_WARNING, "IMAGE: ImageDrawText() requires module: rtext");
#endif
Expand Down

0 comments on commit 48e2663

Please sign in to comment.