From ac8ec2b6224cf36085284ea9c586fc21fdc6a383 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 c9de53b8f..4fefa3722 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