fix: corregir escalado de texto en resoluciones altas y F4 fullscreen
- updatePhysicalWindowSize() acepta logical_height opcional para actualizar logical_window_height_ al entrar/salir de F4 real fullscreen - Engine pasa current_screen_height_ a UIManager en cada cambio de tamaño físico, propagando la resolución lógica correcta - calculateFontSize() subdivide el rango >=900px en tres tramos más conservadores (/40, /48, /60) para evitar texto excesivamente grande en resoluciones como 2000x1200 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 ===
|
||||
|
||||
|
||||
Reference in New Issue
Block a user