fix: Help Overlay - fullscreen resize roto y padding inferior

Correcciones críticas para overlay en fullscreen y padding:

1. Fullscreen/resize roto CORREGIDO:
   - Problema: orden incorrecto de actualizaciones causaba mezcla de
     dimensiones antiguas (800x600) con font nuevo (24px)
   - Solución: nuevo método updateAll() que actualiza font Y dimensiones
     de forma atómica
   - Flujo correcto: dimensiones físicas → font → recalcular box
   - Antes: overlay gigante y descuadrado al cambiar fullscreen
   - Ahora: overlay se reposiciona y escala correctamente

2. Padding inferior inexistente CORREGIDO:
   - Problema: calculateTextDimensions() usaba num_lines/2 asumiendo
     división perfecta entre columnas
   - Problema 2: rebuildCachedTexture() no verificaba límite inferior
     en columna 1
   - Solución: contar líneas REALES en cada columna y usar el máximo
   - Fórmula correcta: line_height*2 + max_column_lines*line_height + padding*2
   - Ahora: padding inferior respetado siempre

3. Implementación técnica:
   - HelpOverlay::updateAll(font, width, height) nuevo método unificado
   - UIManager llama updateAll() en lugar de reinitializeFontSize() +
     updatePhysicalWindowSize() separadamente
   - Elimina race condition entre actualización de font y dimensiones

Resultado:
- F3/F4 (fullscreen) funciona correctamente
- Resize ventana (F1/F2) funciona correctamente
- Padding inferior respetado en ambas columnas
- Sin overlays gigantes o descuadrados

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-16 21:32:32 +02:00
parent 7c0a60f140
commit 1b3d32ba84
3 changed files with 57 additions and 14 deletions

View File

@@ -175,18 +175,15 @@ void UIManager::updatePhysicalWindowSize(int width, int height) {
if (text_renderer_notifier_) {
text_renderer_notifier_->reinitialize(current_font_size_);
}
// Reinicializar help overlay con nuevo tamaño de fuente
if (help_overlay_) {
help_overlay_->reinitializeFontSize(current_font_size_);
}
}
// Actualizar componentes de UI con nuevas dimensiones
notifier_->updateWindowSize(width, height);
// Actualizar help overlay con font size actual Y nuevas dimensiones (atómicamente)
if (help_overlay_) {
help_overlay_->updatePhysicalWindowSize(width, height);
help_overlay_->updateAll(current_font_size_, width, height);
}
// Actualizar otros componentes de UI con nuevas dimensiones
notifier_->updateWindowSize(width, height);
}
void UIManager::setTextObsolete(const std::string& text, int pos, int current_screen_width) {