fix: Force scaling of default font to be a integer multiple

This commit is contained in:
WerWolv
2024-01-03 18:26:48 +01:00
parent ed8934882e
commit c402d58685
2 changed files with 2 additions and 1 deletions
@@ -230,6 +230,7 @@ namespace hex::plugin::builtin {
if (fontFile.empty()) {
defaultConfig.FontBuilderFlags |= ImGuiFreeTypeBuilderFlags_Monochrome | ImGuiFreeTypeBuilderFlags_MonoHinting;
defaultConfig.SizePixels = std::floor(ImHexApi::Fonts::getFontSize() / ImHexApi::Fonts::DefaultFontSize) * ImHexApi::Fonts::DefaultFontSize;
defaultFont = fonts->AddFontDefault(&defaultConfig);
} else {
defaultFont = fonts->AddFontFromFileTTF(wolv::util::toUTF8String(fontFile).c_str(), 0, &defaultConfig, defaultGlyphRanges.Data);