impr: Refactor previous commits to work with other environments too

This commit is contained in:
WerWolv
2024-12-28 21:37:45 +01:00
parent 534a2f1d28
commit 1298f2b688
7 changed files with 30 additions and 24 deletions

View File

@@ -218,15 +218,11 @@ namespace hex::fonts {
}
private:
float getAdjustedFontSize(float fontSize) {
float getAdjustedFontSize(float fontSize) const {
// Since macOS reports half the framebuffer size that's actually available,
// we'll multiply all font sizes by that and then divide the global font scale
// by the same amount to get super crisp font rendering.
#if defined(OS_MACOS)
return fontSize * getBackingScaleFactor();
#else
return fontSize;
#endif
return fontSize * hex::ImHexApi::System::getBackingScaleFactor();
}
private: