mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-08 08:31:13 +00:00
Fix wallpaper motion
This commit is contained in:
parent
8614bc0d3e
commit
9b7fa8b24c
@ -27,10 +27,12 @@ public final class WallpaperBackgroundNode: ASDisplayNode {
|
|||||||
self.contentNode.view.removeMotionEffect(effect)
|
self.contentNode.view.removeMotionEffect(effect)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if !self.frame.isEmpty {
|
||||||
self.updateScale()
|
self.updateScale()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public var image: UIImage? {
|
public var image: UIImage? {
|
||||||
didSet {
|
didSet {
|
||||||
@ -67,7 +69,12 @@ public final class WallpaperBackgroundNode: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) {
|
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.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))
|
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