fix: corregir guard de padding inferior en HelpOverlay

El guard usaba `current_y + line_height >= box_height_ - padding`,
lo que cortaba la última línea de col0 (Num/) por un solo píxel.
Cambiado a `current_y + glyph_height > box_height_ - padding` para
usar el alto visual real del glifo en lugar del line_height completo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-20 20:59:31 +01:00
parent dcea4ebbab
commit f71f7cd5ed

View File

@@ -31,9 +31,9 @@ HelpOverlay::HelpOverlay()
{"1-8", "Escenarios (10 a 50.000 pelotas)"}, {"1-8", "Escenarios (10 a 50.000 pelotas)"},
{"F", "Cambia entre figura y física"}, {"F", "Cambia entre figura y física"},
{"B", "Cambia entre boids y física"}, {"B", "Cambia entre boids y física"},
{"ESPACIO", "Impulso contra gravedad"}, {"ESPACIO", "Impulso contra la gravedad"},
{"G", "Activar / Desactivar gravedad"}, {"G", "Activar / Desactivar gravedad"},
{"CURSORES", "Dirección de gravedad"}, {"CURSORES", "Dirección de la gravedad"},
{"", ""}, // Separador {"", ""}, // Separador
// COLUMNA 1: FIGURAS 3D // COLUMNA 1: FIGURAS 3D
@@ -252,6 +252,7 @@ void HelpOverlay::calculateBoxDimensions() {
// Centrar en pantalla // Centrar en pantalla
box_x_ = (physical_width_ - box_width_) / 2; box_x_ = (physical_width_ - box_width_) / 2;
box_y_ = (physical_height_ - box_height_) / 2; box_y_ = (physical_height_ - box_height_) / 2;
} }
void HelpOverlay::rebuildCachedTexture() { void HelpOverlay::rebuildCachedTexture() {
@@ -353,6 +354,7 @@ void HelpOverlay::rebuildCachedTexture() {
// Ancho de cada columna (para centrado interno) // Ancho de cada columna (para centrado interno)
int col_width[3] = {column1_width_, column2_width_, column3_width_}; int col_width[3] = {column1_width_, column2_width_, column3_width_};
int glyph_height = text_renderer_->getGlyphHeight();
int current_y = padding; int current_y = padding;
int current_column = 0; int current_column = 0;
@@ -369,7 +371,8 @@ void HelpOverlay::rebuildCachedTexture() {
} }
// CHECK PADDING INFERIOR ANTES de escribir la línea // CHECK PADDING INFERIOR ANTES de escribir la línea
if (current_y + line_height >= box_height_ - padding) { // Usamos glyph_height (no line_height) porque el gap después de la última línea no ocupa espacio visual
if (current_y + glyph_height > box_height_ - padding) {
continue; continue;
} }