fix zoom detection issue in old OSX versions

This commit is contained in:
2019-08-15 22:52:14 +02:00
parent 56f4bc467d
commit bb7d681dc3
4 changed files with 12 additions and 2 deletions

View File

@@ -467,7 +467,9 @@
view = [[View alloc] initWithFrame:r];
controller = [[Controller alloc] initWithWindow:window];
App::I->osx_view = view;
App::I->zoom = Settings::value_or<Serializer::Float>("ui-scale", (float)view.layer.contentsScale);
float z = (float)window.backingScaleFactor;
App::I->zoom = Settings::value_or<Serializer::Float>("ui-scale", (z > 0.f) ? z : 1.f);
auto style = NSTitledWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask|NSClosableWindowMask;
window = [[Window alloc] initWithContentRect:r styleMask:style backing:NSBackingStoreBuffered defer:NO];