Skip to content

Commit

Permalink
display(iOS): fix resize issues
Browse files Browse the repository at this point in the history
Fixes #6179
  • Loading branch information
osy committed Mar 30, 2024
1 parent 9846260 commit 8bce9d1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Platform/iOS/Display/VMDisplayMetalViewController+Touch.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 8bce9d1

Please sign in to comment.