1
0
mirror of synced 2024-11-24 15:50:16 +01:00

fix: Clearing custom font path not updating setting correctly

This commit is contained in:
WerWolv 2022-09-20 15:47:28 +02:00
parent 7e61b513f3
commit 9656b40d53
2 changed files with 3 additions and 3 deletions

View File

@ -133,7 +133,7 @@ namespace hex::init {
0x0100, 0xFFF0, 0
};
auto fontFile = ImHexApi::System::getCustomFontPath();
const auto &fontFile = ImHexApi::System::getCustomFontPath();
float fontSize = ImHexApi::System::getFontSize();
if (fontFile.empty()) {
// Load default font if no custom one has been specified

View File

@ -494,11 +494,11 @@ namespace hex::plugin::builtin {
}
}
ImHexApi::System::impl::setCustomFontPath(fontFile);
// If a custom font has been loaded now, also load the font size
float fontSize = ImHexApi::System::DefaultFontSize * ImHexApi::System::getGlobalScale();
if (!fontFile.empty()) {
ImHexApi::System::impl::setCustomFontPath(fontFile);
fontSize = ContentRegistry::Settings::read("hex.builtin.setting.font", "hex.builtin.setting.font.font_size", 13) * ImHexApi::System::getGlobalScale();
}