Skip to content

Commit

Permalink
display(iOS): use current screen for scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
osy committed Aug 3, 2022
1 parent 2d98e00 commit c0887da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Platform/iOS/Display/VMDisplayMetalViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ - (void)displayResize:(CGSize)size {
UTMLog(@"resizing to (%f, %f)", size.width, size.height);
CGRect bounds = CGRectMake(0, 0, size.width, size.height);
if (self.delegate.qemuDisplayIsNativeResolution) {
CGFloat scale = [UIScreen mainScreen].scale;
UIScreen *screen = self.view.window.screen;
if (screen == nil) {
screen = UIScreen.mainScreen;
}
CGFloat scale = screen.scale;
CGAffineTransform transform = CGAffineTransformMakeScale(scale, scale);
bounds = CGRectApplyAffineTransform(bounds, transform);
}
Expand Down

0 comments on commit c0887da

Please sign in to comment.