CtrlCore: MacOS multimonitor with mixed UHD fix

git-svn-id: svn://ultimatepp.org/upp/trunk@13979 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2020-02-10 11:32:19 +00:00
parent 4ca54df979
commit 42bfcc3d93

View file

@ -72,12 +72,14 @@ void CocoInit(int argc, const char **argv, const char **envptr)
Font::SetFace(0, ToString((CFStringRef)[sysfont familyName]), Font::TTF);
Ctrl::SetUHDEnabled(true);
bool uhd = true;
for (NSScreen *screen in [NSScreen screens]) {
if([screen backingScaleFactor] > 1) {
SetUHDMode(true);
if([screen backingScaleFactor] < 2) {
uhd = false;
break;
}
}
SetUHDMode(uhd);
Font::SetDefaultFont(StdFont(fceil(DPI([sysfont pointSize]))));