mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Fix wallpaper motion
This commit is contained in:
parent
8614bc0d3e
commit
9b7fa8b24c
@ -27,7 +27,9 @@ public final class WallpaperBackgroundNode: ASDisplayNode {
|
||||
self.contentNode.view.removeMotionEffect(effect)
|
||||
}
|
||||
}
|
||||
self.updateScale()
|
||||
if !self.frame.isEmpty {
|
||||
self.updateScale()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -67,7 +69,12 @@ public final class WallpaperBackgroundNode: ASDisplayNode {
|
||||
}
|
||||
|
||||
public func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) {
|
||||
let isFirstLayout = self.frame.isEmpty
|
||||
transition.updatePosition(node: self.contentNode, position: CGPoint(x: size.width / 2.0, y: size.height / 2.0))
|
||||
transition.updateBounds(node: self.contentNode, bounds: CGRect(origin: CGPoint(), size: size))
|
||||
|
||||
if isFirstLayout && !self.frame.isEmpty {
|
||||
self.updateScale()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user