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,8 +386,15 @@ public struct Transition {
|
||||
let t = layer.presentation()?.transform ?? layer.transform
|
||||
let currentScale = sqrt((t.m11 * t.m11) + (t.m12 * t.m12) + (t.m13 * t.m13))
|
||||
if currentScale == scale {
|
||||
completion?(true)
|
||||
return
|
||||
if let animation = layer.animation(forKey: "transform.scale") as? CABasicAnimation, let toValue = animation.toValue as? NSNumber {
|
||||
if toValue.doubleValue == scale {
|
||||
completion?(true)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
completion?(true)
|
||||
return
|
||||
}
|
||||
}
|
||||
switch self.animation {
|
||||
case .none:
|
||||
|
Loading…
x
Reference in New Issue
Block a user