mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
[WIP] Call UI
This commit is contained in:
@@ -481,8 +481,14 @@ public struct Transition {
|
||||
}
|
||||
|
||||
public func setScale(layer: CALayer, scale: CGFloat, delay: Double = 0.0, completion: ((Bool) -> Void)? = nil) {
|
||||
let t = layer.presentation()?.transform ?? layer.transform
|
||||
let currentScale = sqrt((t.m11 * t.m11) + (t.m12 * t.m12) + (t.m13 * t.m13))
|
||||
let currentTransform: CATransform3D
|
||||
if layer.animation(forKey: "transform") != nil || layer.animation(forKey: "transform.scale") != nil {
|
||||
currentTransform = layer.presentation()?.transform ?? layer.transform
|
||||
} else {
|
||||
currentTransform = layer.transform
|
||||
}
|
||||
|
||||
let currentScale = sqrt((currentTransform.m11 * currentTransform.m11) + (currentTransform.m12 * currentTransform.m12) + (currentTransform.m13 * currentTransform.m13))
|
||||
if currentScale == scale {
|
||||
if let animation = layer.animation(forKey: "transform.scale") as? CABasicAnimation, let toValue = animation.toValue as? NSNumber {
|
||||
if toValue.doubleValue == scale {
|
||||
|
||||
Reference in New Issue
Block a user