fix: Force scaling of default font to be a integer multiple
This commit is contained in:
parent
ed8934882e
commit
c402d58685
@ -230,6 +230,7 @@ namespace hex::plugin::builtin {
|
|||||||
|
|
||||||
if (fontFile.empty()) {
|
if (fontFile.empty()) {
|
||||||
defaultConfig.FontBuilderFlags |= ImGuiFreeTypeBuilderFlags_Monochrome | ImGuiFreeTypeBuilderFlags_MonoHinting;
|
defaultConfig.FontBuilderFlags |= ImGuiFreeTypeBuilderFlags_Monochrome | ImGuiFreeTypeBuilderFlags_MonoHinting;
|
||||||
|
defaultConfig.SizePixels = std::floor(ImHexApi::Fonts::getFontSize() / ImHexApi::Fonts::DefaultFontSize) * ImHexApi::Fonts::DefaultFontSize;
|
||||||
defaultFont = fonts->AddFontDefault(&defaultConfig);
|
defaultFont = fonts->AddFontDefault(&defaultConfig);
|
||||||
} else {
|
} else {
|
||||||
defaultFont = fonts->AddFontFromFileTTF(wolv::util::toUTF8String(fontFile).c_str(), 0, &defaultConfig, defaultGlyphRanges.Data);
|
defaultFont = fonts->AddFontFromFileTTF(wolv::util::toUTF8String(fontFile).c_str(), 0, &defaultConfig, defaultGlyphRanges.Data);
|
||||||
|
@ -166,7 +166,7 @@ namespace hex::plugin::builtin {
|
|||||||
bool draw(const std::string &name) override {
|
bool draw(const std::string &name) override {
|
||||||
auto format = [this] -> std::string {
|
auto format = [this] -> std::string {
|
||||||
if (m_value == 0)
|
if (m_value == 0)
|
||||||
return "hex.builtin.setting.interface.scaling.native"_lang;
|
return "hex.builtin.setting.interface.scaling.native"_lang + hex::format(" (x{:.1f})", ImHexApi::System::getNativeScale());
|
||||||
else
|
else
|
||||||
return "x%.1f";
|
return "x%.1f";
|
||||||
}();
|
}();
|
||||||
|
Loading…
Reference in New Issue
Block a user