From 618a516c47071aea4bf21d8e277f4562aabe4849 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Tue, 27 Jul 2021 23:18:38 +0300 Subject: [PATCH] Various Fixes --- .../Sources/TGCameraController.m | 6 ++++-- .../Sources/TGCameraMainPhoneView.m | 8 ++++---- .../Sources/TGCameraZoomView.m | 18 ++++++++++++------ 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/submodules/LegacyComponents/Sources/TGCameraController.m b/submodules/LegacyComponents/Sources/TGCameraController.m index a7e351ff91..cd1da999f4 100644 --- a/submodules/LegacyComponents/Sources/TGCameraController.m +++ b/submodules/LegacyComponents/Sources/TGCameraController.m @@ -2679,7 +2679,9 @@ static CGPoint TGCameraControllerClampPointToScreenSize(__unused id self, __unus { case PGCameraModeVideo: { - if (widescreenWidth == 896.0f) + if (widescreenWidth == 926.0f) + return CGRectMake(0, 82, screenSize.width, screenSize.height - 82 - 83); + else if (widescreenWidth == 896.0f) return CGRectMake(0, 77, screenSize.width, screenSize.height - 77 - 83); else if (widescreenWidth == 812.0f) return CGRectMake(0, 77, screenSize.width, screenSize.height - 77 - 68); @@ -2705,7 +2707,7 @@ static CGPoint TGCameraControllerClampPointToScreenSize(__unused id self, __unus default: { if (widescreenWidth == 926.0f) - return CGRectMake(0, 154, screenSize.width, screenSize.height - 154 - 249); + return CGRectMake(0, 121, screenSize.width, screenSize.height - 121 - 234); if (widescreenWidth == 896.0f) return CGRectMake(0, 121, screenSize.width, screenSize.height - 121 - 223); else if (widescreenWidth == 844.0f) diff --git a/submodules/LegacyComponents/Sources/TGCameraMainPhoneView.m b/submodules/LegacyComponents/Sources/TGCameraMainPhoneView.m index 91e84d82fb..3da20cad91 100644 --- a/submodules/LegacyComponents/Sources/TGCameraMainPhoneView.m +++ b/submodules/LegacyComponents/Sources/TGCameraMainPhoneView.m @@ -113,11 +113,11 @@ CGFloat widescreenWidth = MAX(screenSize.width, screenSize.height); if (widescreenWidth == 926.0f) { - _topPanelOffset = 77.0f; + _topPanelOffset = 34.0f; _topPanelHeight = 77.0f; _bottomPanelOffset = 94.0f; - _bottomPanelHeight = 155.0f; - _modeControlOffset = 6.0f; + _bottomPanelHeight = 140.0f; + _modeControlOffset = -2.0f; _modeControlHeight = 66.0f; _counterOffset = 7.0f; shutterButtonWidth = 72.0f; @@ -133,7 +133,7 @@ _counterOffset = 7.0f; shutterButtonWidth = 72.0f; } - if (widescreenWidth == 844.0f) + else if (widescreenWidth == 844.0f) { _topPanelOffset = 33.0f; _topPanelHeight = 44.0f; diff --git a/submodules/LegacyComponents/Sources/TGCameraZoomView.m b/submodules/LegacyComponents/Sources/TGCameraZoomView.m index ae686a0a23..0b8a9d279f 100644 --- a/submodules/LegacyComponents/Sources/TGCameraZoomView.m +++ b/submodules/LegacyComponents/Sources/TGCameraZoomView.m @@ -343,8 +343,10 @@ } - (void)leftPressed { - [self setZoomLevel:0.5 animated:true]; - self.zoomChanged(0.5, true, true); + if (_zoomLevel != 0.5) { + [self setZoomLevel:0.5 animated:true]; + self.zoomChanged(0.5, true, true); + } } - (void)centerPressed { @@ -362,14 +364,18 @@ self.zoomChanged(1.0, true, true); } } else { - [self setZoomLevel:1.0 animated:true]; - self.zoomChanged(1.0, true, true); + if (_zoomLevel != 1.0) { + [self setZoomLevel:1.0 animated:true]; + self.zoomChanged(1.0, true, true); + } } } - (void)rightPressed { - [self setZoomLevel:2.0 animated:true]; - self.zoomChanged(2.0, true, true); + if (_zoomLevel != 2.0) { + [self setZoomLevel:2.0 animated:true]; + self.zoomChanged(2.0, true, true); + } } - (void)setZoomLevel:(CGFloat)zoomLevel {