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,15 +31,15 @@ HelpOverlay::HelpOverlay()
{"1-8", "Escenarios (10 a 50.000 pelotas)"},
{"F", "Cambia entre figura y física"},
{"B", "Cambia entre boids y física"},
{"ESPACIO", "Impulso contra gravedad"},
{"ESPACIO", "Impulso contra la gravedad"},
{"G", "Activar / Desactivar gravedad"},
{"CURSORES", "Dirección de gravedad"},
{"CURSORES", "Dirección de la gravedad"},
{"", ""}, // Separador
// COLUMNA 1: FIGURAS 3D
{"FIGURAS 3D", ""},
{"Q/W/E/R", "Esfera/Lissajous/Hélice/Toroide"},
{"T/Y/U/I", "Cubo/Cilindro/Icosaedro/Átomo"},
{"Q/W/E/R", "Esfera / Lissajous / Hélice / Toroide"},
{"T/Y/U/I", "Cubo / Cilindro / Icosaedro / Átomo"},
{"Num+/-", "Escalar figura"},
{"Num*", "Reset escala"},
{"Num/", "Activar / Desactivar profundidad"},
@@ -74,7 +74,7 @@ HelpOverlay::HelpOverlay()
{"", ""}, // Separador
// COLUMNA 3: DEBUG/AYUDA
{"DEBUG/AYUDA", ""},
{"DEBUG / AYUDA", ""},
{"F12", "Activar / Desactivar info debug"},
{"H", "Esta ayuda"},
{"ESC", "Salir"}};
@@ -252,6 +252,7 @@ void HelpOverlay::calculateBoxDimensions() {
// Centrar en pantalla
box_x_ = (physical_width_ - box_width_) / 2;
box_y_ = (physical_height_ - box_height_) / 2;
}
void HelpOverlay::rebuildCachedTexture() {
@@ -353,6 +354,7 @@ void HelpOverlay::rebuildCachedTexture() {
// Ancho de cada columna (para centrado interno)
int col_width[3] = {column1_width_, column2_width_, column3_width_};
int glyph_height = text_renderer_->getGlyphHeight();
int current_y = padding;
int current_column = 0;
@@ -369,7 +371,8 @@ void HelpOverlay::rebuildCachedTexture() {
}
// 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;
}