From bb812c7f024b3fa5cb5578168f8b6e2f6a0c5ec0 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Fri, 12 Aug 2022 19:11:58 -0500 Subject: [PATCH] [iPad] Uses window size to determine TouchControllerSkin axis, not interface orientation iPads in landscape orientation should only place DS screens side-by-side if the app window is wider than it is tall. Otherwise, it should use the default vertical screen layout. --- Delta/Emulation/GameViewController.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Delta/Emulation/GameViewController.swift b/Delta/Emulation/GameViewController.swift index a4d2fc9..e5d65bd 100644 --- a/Delta/Emulation/GameViewController.swift +++ b/Delta/Emulation/GameViewController.swift @@ -665,10 +665,13 @@ private extension GameViewController var touchControllerSkin = TouchControllerSkin(controllerSkin: controllerSkin) touchControllerSkin.layoutGuide = self.view.safeAreaLayoutGuide - switch traits.orientation + if self.view.bounds.width > self.view.bounds.height { - case .portrait: touchControllerSkin.screenLayoutAxis = .vertical - case .landscape: touchControllerSkin.screenLayoutAxis = .horizontal + touchControllerSkin.screenLayoutAxis = .horizontal + } + else + { + touchControllerSkin.screenLayoutAxis = .vertical } self.controllerView.controllerSkin = touchControllerSkin