fix: Clearing custom font path not updating setting correctly
This commit is contained in:
parent
7e61b513f3
commit
9656b40d53
@ -133,7 +133,7 @@ namespace hex::init {
|
|||||||
0x0100, 0xFFF0, 0
|
0x0100, 0xFFF0, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
auto fontFile = ImHexApi::System::getCustomFontPath();
|
const auto &fontFile = ImHexApi::System::getCustomFontPath();
|
||||||
float fontSize = ImHexApi::System::getFontSize();
|
float fontSize = ImHexApi::System::getFontSize();
|
||||||
if (fontFile.empty()) {
|
if (fontFile.empty()) {
|
||||||
// Load default font if no custom one has been specified
|
// Load default font if no custom one has been specified
|
||||||
|
@ -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
|
// If a custom font has been loaded now, also load the font size
|
||||||
float fontSize = ImHexApi::System::DefaultFontSize * ImHexApi::System::getGlobalScale();
|
float fontSize = ImHexApi::System::DefaultFontSize * ImHexApi::System::getGlobalScale();
|
||||||
if (!fontFile.empty()) {
|
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();
|
fontSize = ContentRegistry::Settings::read("hex.builtin.setting.font", "hex.builtin.setting.font.font_size", 13) * ImHexApi::System::getGlobalScale();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user