mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Attempt to fix invalid frame update
This commit is contained in:
parent
9cf0acaf38
commit
f8b28f2416
@ -71,6 +71,26 @@ public enum ContainedViewLayoutTransition {
|
|||||||
|
|
||||||
public extension ContainedViewLayoutTransition {
|
public extension ContainedViewLayoutTransition {
|
||||||
func updateFrame(node: ASDisplayNode, frame: CGRect, force: Bool = false, beginWithCurrentState: Bool = false, delay: Double = 0.0, completion: ((Bool) -> Void)? = nil) {
|
func updateFrame(node: ASDisplayNode, frame: CGRect, force: Bool = false, beginWithCurrentState: Bool = false, delay: Double = 0.0, completion: ((Bool) -> Void)? = nil) {
|
||||||
|
var frame = frame
|
||||||
|
if frame.origin.x.isNaN {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if frame.origin.y.isNaN {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if frame.size.width.isNaN {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if frame.size.width < 0.0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if frame.size.height.isNaN {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if frame.size.height < 0.0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if node.frame.equalTo(frame) && !force {
|
if node.frame.equalTo(frame) && !force {
|
||||||
completion?(true)
|
completion?(true)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user