Merge pull request #2361 from akihikodaki/master
Fix resolution scaling from Cocoa to guest
This commit is contained in:
commit
aaee0ffc16
|
@ -67,6 +67,6 @@ fastlane/test_output
|
|||
|
||||
iOSInjectionProject/
|
||||
|
||||
build/
|
||||
build*/
|
||||
sysroot*/
|
||||
.DS_Store
|
||||
|
|
|
@ -187,7 +187,7 @@ extension VMDisplayMetalWindowController {
|
|||
fileprivate func updateGuestResolution(for window: NSWindow, frameSize: NSSize) -> NSSize {
|
||||
guard let vmDisplay = self.vmDisplay else { return frameSize }
|
||||
let currentScreenScale = window.screen?.backingScaleFactor ?? 1.0
|
||||
let nativeScale = isAlwaysNativeResolution ? 1.0 : currentScreenScale
|
||||
let nativeScale = isAlwaysNativeResolution ? currentScreenScale : 1.0
|
||||
let targetSize = window.contentRect(forFrameRect: CGRect(origin: .zero, size: frameSize)).size
|
||||
let targetSizeScaled = isAlwaysNativeResolution ? targetSize.applying(CGAffineTransform(scaleX: nativeScale, y: nativeScale)) : targetSize
|
||||
logger.debug("Requesting resolution: (\(targetSizeScaled.width), \(targetSizeScaled.height))")
|
||||
|
|
Loading…
Reference in New Issue