Update text-size related caches after changing font details
This commit is contained in:
@@ -2286,6 +2286,8 @@ DEF_CONSOLE_CMD(ConFont)
|
||||
IConsolePrintF(CC_DEFAULT, "%s: \"%s\" %d %s [\"%s\" %d %s]", FontSizeToName(fs), fc->GetFontName().c_str(), fc->GetFontSize(), GetFontAAState(fs) ? "aa" : "noaa", setting->font.c_str(), setting->size, setting->aa ? "aa" : "noaa");
|
||||
}
|
||||
|
||||
FontChanged();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
12
src/gfx.cpp
12
src/gfx.cpp
@@ -2222,6 +2222,18 @@ bool AdjustGUIZoom(AdjustGUIZoomMode mode)
|
||||
return true;
|
||||
}
|
||||
|
||||
void FontChanged()
|
||||
{
|
||||
extern void FlushDeparturesWindowTextCaches();
|
||||
FlushDeparturesWindowTextCaches();
|
||||
|
||||
UpdateRouteStepSpriteSize();
|
||||
|
||||
SetupWidgetDimensions();
|
||||
UpdateAllVirtCoords();
|
||||
ReInitAllWindows(true);
|
||||
}
|
||||
|
||||
void ChangeGameSpeed(bool enable_fast_forward)
|
||||
{
|
||||
if (enable_fast_forward) {
|
||||
|
@@ -97,6 +97,8 @@ enum AdjustGUIZoomMode {
|
||||
};
|
||||
bool AdjustGUIZoom(AdjustGUIZoomMode mode);
|
||||
|
||||
void FontChanged();
|
||||
|
||||
void RedrawScreenRect(int left, int top, int right, int bottom);
|
||||
|
||||
Dimension GetSpriteSize(SpriteID sprid, Point *offset = nullptr, ZoomLevel zoom = ZOOM_LVL_GUI);
|
||||
|
@@ -596,8 +596,8 @@ struct GameOptionsWindow : Window {
|
||||
InitFontCache(false);
|
||||
InitFontCache(true);
|
||||
ClearFontCache();
|
||||
SetupWidgetDimensions();
|
||||
ReInitAllWindows(true);
|
||||
|
||||
FontChanged();
|
||||
break;
|
||||
|
||||
case WID_GO_GUI_FONT_AA:
|
||||
|
Reference in New Issue
Block a user