From f71f7cd5ed92909798edd7b50051dd47686c109b Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Fri, 20 Mar 2026 20:59:31 +0100 Subject: [PATCH] fix: corregir guard de padding inferior en HelpOverlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- source/ui/help_overlay.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/source/ui/help_overlay.cpp b/source/ui/help_overlay.cpp index 5af0b12..2e3e558 100644 --- a/source/ui/help_overlay.cpp +++ b/source/ui/help_overlay.cpp @@ -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; }