From d15e5834607187ba73c13be906be98848f4e93c0 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 29 Oct 2024 09:37:38 +0100 Subject: [PATCH] Update rtext.c --- src/rtext.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 5665b01f..81bfe1a8 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1282,7 +1282,8 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing { Vector2 textSize = { 0 }; - if ((isGpuReady && (font.texture.id == 0)) || (text == NULL)) return textSize; // Security check + if ((isGpuReady && (font.texture.id == 0)) || + (text == NULL) || (text[0] == '\0')) return textSize; // Security check int size = TextLength(text); // Get size in bytes of text int tempByteCounter = 0; // Used to count longer text line num chars @@ -1327,7 +1328,7 @@ Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing if (tempTextWidth < textWidth) tempTextWidth = textWidth; - if (size > 0) textSize.x = tempTextWidth*scaleFactor + (float)((tempByteCounter - 1)*spacing); + textSize.x = tempTextWidth*scaleFactor + (float)((tempByteCounter - 1)*spacing); textSize.y = textHeight; return textSize;