mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Don't animate message background unless it's changed
This commit is contained in:
parent
903966a7e2
commit
085e2f41ee
@ -229,7 +229,9 @@ class ChatMessageBackground: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
} else if transition.isAnimated {
|
} else if transition.isAnimated {
|
||||||
if let previousContents = self.imageNode.layer.contents, let image = image {
|
if let previousContents = self.imageNode.layer.contents, let image = image {
|
||||||
self.imageNode.layer.animate(from: previousContents as AnyObject, to: image.cgImage! as AnyObject, keyPath: "contents", timingFunction: CAMediaTimingFunctionName.easeInEaseOut.rawValue, duration: 0.42)
|
if (previousContents as AnyObject) !== image.cgImage {
|
||||||
|
self.imageNode.layer.animate(from: previousContents as AnyObject, to: image.cgImage! as AnyObject, keyPath: "contents", timingFunction: CAMediaTimingFunctionName.easeInEaseOut.rawValue, duration: 0.42)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user