summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
authorPeterN <peter@fuzzle.org>2019-02-24 16:27:44 +0000
committerGitHub <noreply@github.com>2019-02-24 16:27:44 +0000
commit195fd0dc60cc895539ac6c04ff83b6f99f739830 (patch)
treef5cbcd397645ae1f1a8075bbc9bd5a85ded86bb0 /src/gfx.cpp
parent91eee793e1632c124c22ee46911e7de5fb3a2362 (diff)
downloadopenttd-195fd0dc60cc895539ac6c04ff83b6f99f739830.tar.xz
Fix #7266: Reorder reinitialization of caches when changing font zoom level. (#7273)
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 0f050971c..7a6b827b7 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -1131,13 +1131,14 @@ TextColour GetContrastColour(uint8 background, uint8 threshold)
*/
void LoadStringWidthTable(bool monospace)
{
+ ClearFontCache();
+
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);
}
}
- ClearFontCache();
ReInitAllWindows();
}