Optimize autoscrolling

This commit is contained in:
Ali
2020-04-07 19:05:48 +04:00
parent 768608fc88
commit f9ddb6ade8
2 changed files with 30 additions and 3 deletions

View File

@@ -605,6 +605,12 @@ private final class StickerPackContainer: ASDisplayNode {
self.expandProgressUpdated(self, expandProgressTransition)
}
if !transition.isAnimated {
self.backgroundNode.layer.removeAllAnimations()
self.titleContainer.layer.removeAllAnimations()
self.titleSeparatorNode.layer.removeAllAnimations()
}
let backgroundFrame = CGRect(origin: CGPoint(x: 0.0, y: max(minBackgroundY, unclippedBackgroundY)), size: CGSize(width: layout.size.width, height: layout.size.height))
transition.updateFrame(node: self.backgroundNode, frame: backgroundFrame)
transition.updateFrame(node: self.titleContainer, frame: CGRect(origin: CGPoint(x: backgroundFrame.minX + floor((backgroundFrame.width) / 2.0), y: backgroundFrame.minY + floor((50.0) / 2.0)), size: CGSize()))