Windows: Update dpiScale of fonts before recreating them on resize. Fixes #9437

This commit is contained in:
Henrik Rydgård 2017-03-17 13:29:22 +01:00
parent aefad893f8
commit 8a29705165
2 changed files with 2 additions and 1 deletions

View File

@ -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;

View File

@ -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();
}
}