diff --git a/source/engine.cpp b/source/engine.cpp index b548ca6..c8da655 100644 --- a/source/engine.cpp +++ b/source/engine.cpp @@ -1285,7 +1285,10 @@ void Engine::updatePhysicalWindowSize() { } // Notificar a UIManager del cambio de tamaño (delegado) - ui_manager_->updatePhysicalWindowSize(physical_window_width_, physical_window_height_); + // Pasar current_screen_height_ para que UIManager actualice la altura lógica + // (necesario en F4 donde la resolución lógica cambia a la del display) + ui_manager_->updatePhysicalWindowSize(physical_window_width_, physical_window_height_, + current_screen_height_); } diff --git a/source/ui/ui_manager.cpp b/source/ui/ui_manager.cpp index dd029e4..6631e74 100644 --- a/source/ui/ui_manager.cpp +++ b/source/ui/ui_manager.cpp @@ -172,10 +172,15 @@ void UIManager::updateVSyncText(bool enabled) { vsync_text_ = enabled ? "V-Sync: On" : "V-Sync: Off"; } -void UIManager::updatePhysicalWindowSize(int width, int height) { +void UIManager::updatePhysicalWindowSize(int width, int height, int logical_height) { physical_window_width_ = width; physical_window_height_ = height; + // Actualizar altura lógica si se proporciona (ej. al entrar/salir de F4) + if (logical_height > 0) { + logical_window_height_ = logical_height; + } + // Calcular nuevo tamaño de fuente apropiado basado en altura LÓGICA // (las dimensiones lógicas no cambian con zoom, solo con cambios explícitos de resolución) int new_font_size = calculateFontSize(logical_window_height_); @@ -418,9 +423,15 @@ int UIManager::calculateFontSize(int logical_height) const { } else if (logical_height < 900) { // Rango medio-alto (700-899px) → 18px font_size = 18; + } else if (logical_height < 1200) { + // Rango alto (900-1199px): 900→22, 1080→27, 1199→29 + font_size = logical_height / 40; + } else if (logical_height < 1600) { + // Rango muy alto (1200-1599px): 1200→25, 1440→30 + font_size = logical_height / 48; } else { - // Rango alto: proporcional (1080px→42, 1440px→55, 2160px→72) - font_size = logical_height / 26; + // Rango ultra (>=1600px): 1600→26, 2000→33, 2160→36 + font_size = logical_height / 60; } // Aplicar límites: mínimo 9px, máximo 72px diff --git a/source/ui/ui_manager.hpp b/source/ui/ui_manager.hpp index 1e1d0c5..82fa4cc 100644 --- a/source/ui/ui_manager.hpp +++ b/source/ui/ui_manager.hpp @@ -111,8 +111,9 @@ class UIManager { * @brief Actualiza tamaño físico de ventana (cambios de fullscreen) * @param width Nuevo ancho físico * @param height Nuevo alto físico + * @param logical_height Nuevo alto lógico (0 = sin cambio) */ - void updatePhysicalWindowSize(int width, int height); + void updatePhysicalWindowSize(int width, int height, int logical_height = 0); // === Getters ===