Changeset - r28255:2fb69767d82f
[Not reviewed]
master
0 2 0
Peter Nelson - 7 months ago 2023-11-29 12:35:00
peter1138@openttd.org
Fix: Don't implicitly ReInit all windows after updating the character width cache.

This caused duplicate ReInit when changing interface scale.
2 files changed with 1 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/gfx.cpp
Show inline comments
 
@@ -1403,14 +1403,12 @@ void LoadStringWidthTable(bool monospace
 

	
 
	for (FontSize fs = monospace ? FS_MONO : FS_BEGIN; fs < (monospace ? FS_END : FS_MONO); fs++) {
 
		for (uint i = 0; i != 224; i++) {
 
			_stringwidth_table[fs][i] = GetGlyphWidth(fs, i + 32);
 
		}
 
	}
 

	
 
	ReInitAllWindows(false);
 
}
 

	
 
/**
 
 * Return width of character glyph.
 
 * @param size  Font of the character
 
 * @param key   Character code glyph
src/settings_table.cpp
Show inline comments
 
@@ -267,12 +267,13 @@ static void ZoomMinMaxChanged(int32_t)
 
	GfxClearSpriteCache();
 
	if (_settings_client.gui.zoom_min > _gui_zoom) {
 
		/* Restrict GUI zoom if it is no longer available. */
 
		_gui_zoom = _settings_client.gui.zoom_min;
 
		UpdateCursorSize();
 
		LoadStringWidthTable();
 
		ReInitAllWindows(true);
 
	}
 
}
 

	
 
static void SpriteZoomMinChanged(int32_t)
 
{
 
	GfxClearSpriteCache();
0 comments (0 inline, 0 general)