[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.
This commit is contained in:
Riley Testut 2022-08-12 19:11:58 -05:00
parent 6ba648ed17
commit bb812c7f02

View File

@ -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