From 11a4d6d5f8389ba79ca0c148dd5d74e8ace6d393 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Fri, 4 Oct 2019 15:31:07 +0300 Subject: [PATCH] Wallet: fixed QR scanner orientation on iPads --- submodules/TelegramUI/TelegramUI/AppDelegate.swift | 2 +- submodules/WalletUI/Sources/WalletQrScanScreen.swift | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/submodules/TelegramUI/TelegramUI/AppDelegate.swift b/submodules/TelegramUI/TelegramUI/AppDelegate.swift index 70c464b897..1c6d78bd6c 100644 --- a/submodules/TelegramUI/TelegramUI/AppDelegate.swift +++ b/submodules/TelegramUI/TelegramUI/AppDelegate.swift @@ -613,7 +613,7 @@ final class SharedApplicationContext { }, getAvailableAlternateIcons: { if #available(iOS 10.3, *) { var icons = [PresentationAppIcon(name: "Blue", imageName: "BlueIcon", isDefault: buildConfig.isAppStoreBuild), - PresentationAppIcon(name: "Black", imageName: "BlackIcon", isDefault: buildConfig.isInternalBuild), + PresentationAppIcon(name: "Black", imageName: "BlackIcon"), PresentationAppIcon(name: "BlueClassic", imageName: "BlueClassicIcon"), PresentationAppIcon(name: "BlackClassic", imageName: "BlackClassicIcon"), PresentationAppIcon(name: "BlueFilled", imageName: "BlueFilledIcon"), diff --git a/submodules/WalletUI/Sources/WalletQrScanScreen.swift b/submodules/WalletUI/Sources/WalletQrScanScreen.swift index 5172490e6a..15f52fc4b1 100644 --- a/submodules/WalletUI/Sources/WalletQrScanScreen.swift +++ b/submodules/WalletUI/Sources/WalletQrScanScreen.swift @@ -296,14 +296,10 @@ private final class WalletQrScanScreenNode: ViewControllerTracingNode, UIScrollV let bounds = CGRect(origin: CGPoint(), size: layout.size) if case .tablet = layout.deviceMetrics.type { - if case .landscape = layout.orientation { - let rotation: CGFloat - if UIDevice.current.orientation == .landscapeLeft { - rotation = CGFloat.pi / 2.0 - } else { - rotation = -CGFloat.pi / 2.0 - } + if UIDevice.current.orientation == .landscapeLeft { self.previewNode.transform = CATransform3DMakeRotation(CGFloat.pi / 2.0, 0.0, 0.0, 1.0) + } else if UIDevice.current.orientation == .landscapeRight { + self.previewNode.transform = CATransform3DMakeRotation(-CGFloat.pi / 2.0, 0.0, 0.0, 1.0) } else { self.previewNode.transform = CATransform3DIdentity }