diff --git a/Platform/iOS/Display/VMDisplayMetalViewController+Touch.m b/Platform/iOS/Display/VMDisplayMetalViewController+Touch.m index bf0b94de0..3a254f159 100644 --- a/Platform/iOS/Display/VMDisplayMetalViewController+Touch.m +++ b/Platform/iOS/Display/VMDisplayMetalViewController+Touch.m @@ -459,9 +459,14 @@ - (IBAction)gesturePinch:(UIPinchGestureRecognizer *)sender { sender.state == UIGestureRecognizerStateChanged || sender.state == UIGestureRecognizerStateEnded) { NSAssert(sender.scale > 0, @"sender.scale cannot be 0"); - self.vmDisplay.viewportScale *= sender.scale; - // persist this change in viewState - self.delegate.displayScale = self.vmDisplay.viewportScale; + CGFloat scaling; + if (!self.delegate.qemuDisplayIsNativeResolution) { + // will be undo in `-setDisplayScaling:origin:` + scaling = CGPixelToPoint(CGPointToPixel(self.delegate.displayScale) * sender.scale); + } else { + scaling = self.delegate.displayScale * sender.scale; + } + self.delegate.displayScale = scaling; sender.scale = 1.0; } }