diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -538,24 +538,32 @@ struct GameOptionsWindow : Window { } break; - case WID_GO_GUI_ZOOM_DROPDOWN: - GfxClearSpriteCache(); - _gui_zoom_cfg = index > 0 ? ZOOM_LVL_OUT_4X - index + 1 : ZOOM_LVL_CFG_AUTO; - UpdateGUIZoom(); - UpdateCursorSize(); - UpdateAllVirtCoords(); - FixTitleGameZoom(); - ReInitAllWindows(); + case WID_GO_GUI_ZOOM_DROPDOWN: { + int8 new_zoom = index > 0 ? ZOOM_LVL_OUT_4X - index + 1 : ZOOM_LVL_CFG_AUTO; + if (new_zoom != _gui_zoom_cfg) { + GfxClearSpriteCache(); + _gui_zoom_cfg = new_zoom; + UpdateGUIZoom(); + UpdateCursorSize(); + UpdateAllVirtCoords(); + FixTitleGameZoom(); + ReInitAllWindows(); + } break; + } - case WID_GO_FONT_ZOOM_DROPDOWN: - GfxClearSpriteCache(); - _font_zoom_cfg = index > 0 ? ZOOM_LVL_OUT_4X - index + 1 : ZOOM_LVL_CFG_AUTO; - UpdateGUIZoom(); - ClearFontCache(); - LoadStringWidthTable(); - UpdateAllVirtCoords(); + case WID_GO_FONT_ZOOM_DROPDOWN: { + int8 new_zoom = index > 0 ? ZOOM_LVL_OUT_4X - index + 1 : ZOOM_LVL_CFG_AUTO; + if (new_zoom != _font_zoom_cfg) { + GfxClearSpriteCache(); + _font_zoom_cfg = new_zoom; + UpdateGUIZoom(); + ClearFontCache(); + LoadStringWidthTable(); + UpdateAllVirtCoords(); + } break; + } case WID_GO_BASE_GRF_DROPDOWN: this->SetMediaSet(index);