From a5d99ab33bc3c06af7403acbc438193759c8a0ef Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Thu, 30 Jan 2025 08:42:16 -0800
Subject: [PATCH] Restored original values for min/max x and y
I'm not sure why it was getting cut off originally, but running testgputext with Roboto-Regular.ttf works fine now.
---
src/SDL_ttf.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/SDL_ttf.c b/src/SDL_ttf.c
index d7684b93..c5e240a3 100644
--- a/src/SDL_ttf.c
+++ b/src/SDL_ttf.c
@@ -3629,12 +3629,12 @@ static bool TTF_Size_Internal(TTF_Font *font, const char *text, size_t length, T
return false;
}
- if (positions->len > 0) {
- minx = 0;
- maxx = INT_MIN;
- miny = 0;
- maxy = font->height;
+ minx = 0;
+ maxx = 0;
+ miny = 0;
+ maxy = font->height;
+ if (positions->len > 0) {
if (positions->pos[0].offset == 0) {
// Left to right layout
for (int i = 0; i < positions->len; ++i) {
@@ -3716,11 +3716,6 @@ static bool TTF_Size_Internal(TTF_Font *font, const char *text, size_t length, T
minx = 0;
}
}
- } else {
- minx = 0;
- maxx = 0;
- miny = 0;
- maxy = font->height;
}
// Allows to render a string with only one space (bug 4344).