Fix changing font zoom level not updating font height cache

This commit is contained in:
Jonathan G Rennison
2021-06-10 21:37:27 +01:00
parent 6936fe4f6e
commit 704eac8220
2 changed files with 6 additions and 1 deletions

View File

@@ -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();
}