Fixed photo message animation

This commit is contained in:
Peter 2018-11-21 03:22:39 +03:00
parent 6ee66cc410
commit a99a30ac21

View File

@ -22,6 +22,7 @@ enum InteractiveMediaNodeActivateContent {
final class ChatMessageInteractiveMediaNode: ASDisplayNode {
private let imageNode: TransformImageNode
private var currentImageArguments: TransformImageArguments?
private var videoNode: UniversalVideoNode?
private var statusNode: RadialStatusNode?
private var badgeNode: ChatMessageInteractiveMediaBadge?
@ -396,7 +397,19 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode {
strongSelf.sizeCalculation = sizeCalculation
strongSelf.automaticPlayback = automaticPlayback
strongSelf.automaticDownload = automaticDownload
transition.updateFrame(node: strongSelf.imageNode, frame: imageFrame)
if let previousArguments = strongSelf.currentImageArguments {
if previousArguments.imageSize == arguments.imageSize {
strongSelf.imageNode.frame = imageFrame
} else {
transition.updateFrame(node: strongSelf.imageNode, frame: imageFrame)
}
} else {
strongSelf.imageNode.frame = imageFrame
}
strongSelf.currentImageArguments = arguments
imageApply()
strongSelf.statusNode?.position = CGPoint(x: imageFrame.midX, y: imageFrame.midY)
if let replaceVideoNode = replaceVideoNode {
@ -469,8 +482,6 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode {
strongSelf.fetchControls.with({ $0 })?.fetch(false)
}
imageApply()
strongSelf.updateFetchStatus()
}
})