From 48e2663d03a74b26d86e06057d659ddc9b1b7693 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 2 Jul 2023 10:51:39 +0200 Subject: [PATCH] REVIEWED: Issue #3105 --- src/rtext.c | 2 +- src/rtextures.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index dce838c2..61f2e04c 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -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; diff --git a/src/rtextures.c b/src/rtextures.c index 2d422b17..bc53e1ce 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -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