Fixed button text

This commit is contained in:
2025-12-06 10:48:59 +01:00
parent b44de25113
commit ffdb67ce9b
3 changed files with 6 additions and 6 deletions

View File

@ -92,8 +92,8 @@ void UIRenderer::drawButton(SDL_Renderer* renderer, FontAtlas* font, float cx, f
// Reset color mod
SDL_SetTextureColorMod(icon, 255, 255, 255);
} else if (font) {
// Draw text
float textScale = 1.5f;
// Draw text (smaller scale for tighter buttons)
float textScale = 1.2f;
int textW = 0, textH = 0;
font->measure(label, textScale, textW, textH);
float tx = x + (w - static_cast<float>(textW)) * 0.5f;