Fixed menu

This commit is contained in:
2025-12-06 18:18:27 +01:00
parent 12110bd8b4
commit 8a549d14dc
3 changed files with 44 additions and 16 deletions

View File

@ -108,7 +108,11 @@ void UIRenderer::drawButton(SDL_Renderer* renderer, FontAtlas* font, float cx, f
font->measure(label, textScale, textW, textH);
float tx = x + (w - static_cast<float>(textW)) * 0.5f;
// Adjust vertical position for better alignment with background buttons
float ty = y + (h - static_cast<float>(textH)) * 0.5f + 2.0f;
// Vertically center text precisely within the button
// Vertically center text precisely within the button, then nudge down slightly
// to improve optical balance relative to icons and button art.
const float textNudge = 3.0f; // tweak this value to move labels up/down
float ty = y + (h - static_cast<float>(textH)) * 0.5f + textNudge;
// Choose text color based on selection state
SDL_Color textColor = {255, 255, 255, 255}; // Default white