[macOS] Fix rendering on retina displays with HiDPI support disabled.

This commit is contained in:
bruvzg 2019-01-31 19:24:57 +02:00
parent 463123a661
commit 50e2c1e184
No known key found for this signature in database
GPG key ID: 89DD917D9CE4218D

View file

@ -282,7 +282,9 @@ static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeSt
NSWindow *window = (NSWindow *)[notification object]; NSWindow *window = (NSWindow *)[notification object];
CGFloat newBackingScaleFactor = [window backingScaleFactor]; CGFloat newBackingScaleFactor = [window backingScaleFactor];
CGFloat oldBackingScaleFactor = [[[notification userInfo] objectForKey:@"NSBackingPropertyOldScaleFactorKey"] doubleValue]; CGFloat oldBackingScaleFactor = [[[notification userInfo] objectForKey:@"NSBackingPropertyOldScaleFactorKey"] doubleValue];
[OS_OSX::singleton->window_view setWantsBestResolutionOpenGLSurface:YES]; if (OS_OSX::singleton->is_hidpi_allowed()) {
[OS_OSX::singleton->window_view setWantsBestResolutionOpenGLSurface:YES];
}
if (newBackingScaleFactor != oldBackingScaleFactor) { if (newBackingScaleFactor != oldBackingScaleFactor) {
//Set new display scale and window size //Set new display scale and window size