From 2b1be7bc3008170d4e684977808f9eb7a9d1354e Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 22 Mar 2024 17:52:00 +0100 Subject: [PATCH] fix: Icons not being scaled correctly anymore --- plugins/builtin/source/content/init_tasks.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/init_tasks.cpp b/plugins/builtin/source/content/init_tasks.cpp index c9de53b8f6f7d..4fefa3722b2f0 100644 --- a/plugins/builtin/source/content/init_tasks.cpp +++ b/plugins/builtin/source/content/init_tasks.cpp @@ -278,7 +278,13 @@ namespace hex::plugin::builtin { // Disable merge mode for this font but retain the rest of the configuration cfg.MergeMode = false; - cfg.SizePixels = font.defaultSize.value_or(fontSize); + + auto size = fontSize; + if (font.defaultSize.has_value()) + size = font.defaultSize.value() * ImHexApi::System::getGlobalScale(); + + cfg.SizePixels = size; + ON_SCOPE_EXIT { cfg.MergeMode = true; }; // Construct a range that only contains the first glyph of the font