Fix changing font zoom level not updating font height cache
This commit is contained in:
@@ -2185,6 +2185,8 @@ void UpdateGUIZoom()
|
|||||||
_gui_zoom = static_cast<ZoomLevel>(_gui_zoom_cfg);
|
_gui_zoom = static_cast<ZoomLevel>(_gui_zoom_cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZoomLevel old_font_zoom = _font_zoom;
|
||||||
|
|
||||||
/* Determine real font zoom to use. */
|
/* Determine real font zoom to use. */
|
||||||
if (_font_zoom_cfg == ZOOM_LVL_CFG_AUTO) {
|
if (_font_zoom_cfg == ZOOM_LVL_CFG_AUTO) {
|
||||||
_font_zoom = static_cast<ZoomLevel>(VideoDriver::GetInstance()->GetSuggestedUIZoom());
|
_font_zoom = static_cast<ZoomLevel>(VideoDriver::GetInstance()->GetSuggestedUIZoom());
|
||||||
@@ -2192,6 +2194,10 @@ void UpdateGUIZoom()
|
|||||||
_font_zoom = static_cast<ZoomLevel>(_font_zoom_cfg);
|
_font_zoom = static_cast<ZoomLevel>(_font_zoom_cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (old_font_zoom != _font_zoom) {
|
||||||
|
ClearFontCache();
|
||||||
|
}
|
||||||
|
|
||||||
UpdateFontHeightCache();
|
UpdateFontHeightCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -580,7 +580,6 @@ struct GameOptionsWindow : Window {
|
|||||||
GfxClearSpriteCache();
|
GfxClearSpriteCache();
|
||||||
_font_zoom_cfg = new_zoom;
|
_font_zoom_cfg = new_zoom;
|
||||||
UpdateGUIZoom();
|
UpdateGUIZoom();
|
||||||
ClearFontCache();
|
|
||||||
LoadStringWidthTable();
|
LoadStringWidthTable();
|
||||||
UpdateAllVirtCoords();
|
UpdateAllVirtCoords();
|
||||||
ReInitAllWindows(true);
|
ReInitAllWindows(true);
|
||||||
|
Reference in New Issue
Block a user