Camera and editor improvements

This commit is contained in:
Ilya Laktyushin
2023-06-10 02:23:53 +04:00
parent f0efd5e219
commit 62f92ee5af
7 changed files with 135 additions and 56 deletions

View File

@@ -370,6 +370,12 @@ final class CaptureControlsComponent: Component {
private let lockImage = UIImage(bundleImageName: "Camera/LockIcon")
private var lastFlipTimestamp: Double?
private var didFlip = false
private var wasBanding: Bool?
private var panBlobState: ShutterBlobView.BlobState?
private let hapticFeedback = HapticFeedback()
public func matches(tag: Any) -> Bool {
@@ -425,9 +431,6 @@ final class CaptureControlsComponent: Component {
}
}
private var didFlip = false
private var wasBanding: Bool?
private var panBlobState: ShutterBlobView.BlobState?
@objc private func handlePan(_ gestureRecognizer: UIPanGestureRecognizer) {
guard let component = self.component else {
return
@@ -651,7 +654,15 @@ final class CaptureControlsComponent: Component {
)
),
minSize: CGSize(width: 44.0, height: 44.0),
action: {
action: { [weak self] in
guard let self else {
return
}
let currentTimestamp = CACurrentMediaTime()
if let lastFlipTimestamp = self.lastFlipTimestamp, currentTimestamp - lastFlipTimestamp < 1.3 {
return
}
self.lastFlipTimestamp = currentTimestamp
component.flipTapped()
flipAnimationAction.invoke(Void())
}