Fix changing font zoom level not updating font height cache

pull/273/head
Jonathan G Rennison 3 years ago
parent 6936fe4f6e
commit 704eac8220

@ -2185,6 +2185,8 @@ void UpdateGUIZoom()
_gui_zoom = static_cast<ZoomLevel>(_gui_zoom_cfg);
}
ZoomLevel old_font_zoom = _font_zoom;
/* Determine real font zoom to use. */
if (_font_zoom_cfg == ZOOM_LVL_CFG_AUTO) {
_font_zoom = static_cast<ZoomLevel>(VideoDriver::GetInstance()->GetSuggestedUIZoom());
@ -2192,6 +2194,10 @@ void UpdateGUIZoom()
_font_zoom = static_cast<ZoomLevel>(_font_zoom_cfg);
}
if (old_font_zoom != _font_zoom) {
ClearFontCache();
}
UpdateFontHeightCache();
}

@ -580,7 +580,6 @@ struct GameOptionsWindow : Window {
GfxClearSpriteCache();
_font_zoom_cfg = new_zoom;
UpdateGUIZoom();
ClearFontCache();
LoadStringWidthTable();
UpdateAllVirtCoords();
ReInitAllWindows(true);

Loading…
Cancel
Save