From 8a29705165c168605fdedf49e0023bbf25484b24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 17 Mar 2017 13:29:22 +0100 Subject: [PATCH] Windows: Update dpiScale of fonts before recreating them on resize. Fixes #9437 --- Core/Core.cpp | 2 +- ext/native/gfx_es2/draw_text.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/Core.cpp b/Core/Core.cpp index 36486d9670..44caf06911 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -151,7 +151,7 @@ bool UpdateScreenScale(int width, int height) { smallWindow = IsWindowSmall(width, height); if (smallWindow) { - g_dpi /= 2; + g_dpi /= 2.0f; g_dpi_scale *= 2.0f; } pixel_in_dps = 1.0f / g_dpi_scale; diff --git a/ext/native/gfx_es2/draw_text.cpp b/ext/native/gfx_es2/draw_text.cpp index 387e5fa564..a081da4073 100644 --- a/ext/native/gfx_es2/draw_text.cpp +++ b/ext/native/gfx_es2/draw_text.cpp @@ -351,6 +351,7 @@ void TextDrawer::DrawString(DrawBuffer &target, const char *str, float x, float void TextDrawer::RecreateFonts() { for (auto &iter : fontMap_) { + iter.second->dpiScale = dpiScale_; iter.second->Create(); } }