From ac2c6bdac2da01b5781bb1e119a741df44410c7a Mon Sep 17 00:00:00 2001 From: Chuck Smith Date: Sun, 19 May 2019 21:11:30 +0200 Subject: [PATCH] correctly centers screen on iPhone X landscape --- ui/drivers/cocoa/cocoa_common.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/drivers/cocoa/cocoa_common.m b/ui/drivers/cocoa/cocoa_common.m index 94b71c9b43..9fb9a45e0d 100644 --- a/ui/drivers/cocoa/cocoa_common.m +++ b/ui/drivers/cocoa/cocoa_common.m @@ -209,10 +209,10 @@ void *glkitview_init(void); CGRect newFrame = screenSize; if ( orientation == UIInterfaceOrientationPortrait ) { newFrame = CGRectMake(screenSize.origin.x, screenSize.origin.y + inset.top, screenSize.size.width, screenSize.size.height - inset.top); - } else if ( orientation == UIInterfaceOrientationLandscapeLeft ) { - newFrame = CGRectMake(screenSize.origin.x, screenSize.origin.y, screenSize.size.width - inset.right, screenSize.size.height); - } else if ( orientation == UIInterfaceOrientationLandscapeRight ) { - newFrame = CGRectMake(screenSize.origin.x + inset.left, screenSize.origin.y, screenSize.size.width - inset.left, screenSize.size.height); + } else if ( orientation == UIInterfaceOrientationLandscapeLeft ) { + newFrame = CGRectMake(screenSize.origin.x + inset.right, screenSize.origin.y, screenSize.size.width - inset.right * 2, screenSize.size.height); + } else if ( orientation == UIInterfaceOrientationLandscapeRight ) { + newFrame = CGRectMake(screenSize.origin.x + inset.left, screenSize.origin.y, screenSize.size.width - inset.left * 2, screenSize.size.height); } self.view.frame = newFrame; }