mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix transition to another value while animating
This commit is contained in:
parent
1037b25bc5
commit
268131263a
@ -386,9 +386,16 @@ public struct Transition {
|
|||||||
let t = layer.presentation()?.transform ?? layer.transform
|
let t = layer.presentation()?.transform ?? layer.transform
|
||||||
let currentScale = sqrt((t.m11 * t.m11) + (t.m12 * t.m12) + (t.m13 * t.m13))
|
let currentScale = sqrt((t.m11 * t.m11) + (t.m12 * t.m12) + (t.m13 * t.m13))
|
||||||
if currentScale == scale {
|
if currentScale == scale {
|
||||||
|
if let animation = layer.animation(forKey: "transform.scale") as? CABasicAnimation, let toValue = animation.toValue as? NSNumber {
|
||||||
|
if toValue.doubleValue == scale {
|
||||||
completion?(true)
|
completion?(true)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
completion?(true)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
switch self.animation {
|
switch self.animation {
|
||||||
case .none:
|
case .none:
|
||||||
layer.transform = CATransform3DMakeScale(scale, scale, 1.0)
|
layer.transform = CATransform3DMakeScale(scale, scale, 1.0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user