mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Text-webpage position swap animation
This commit is contained in:
@@ -2070,7 +2070,21 @@ public final class ControlledTransition {
|
||||
if layer.bounds == bounds {
|
||||
return
|
||||
}
|
||||
let fromValue = layer.presentation()?.bounds ?? layer.bounds
|
||||
let fromValue: CGRect
|
||||
if let animationKeys = layer.animationKeys(), animationKeys.contains(where: { key in
|
||||
guard let animation = layer.animation(forKey: key) as? CAPropertyAnimation else {
|
||||
return false
|
||||
}
|
||||
if animation.keyPath == "bounds" {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}) {
|
||||
fromValue = layer.presentation()?.bounds ?? layer.bounds
|
||||
} else {
|
||||
fromValue = layer.bounds
|
||||
}
|
||||
layer.bounds = bounds
|
||||
self.add(animation: ControlledTransitionProperty(
|
||||
layer: layer,
|
||||
|
||||
Reference in New Issue
Block a user