Another fix

This commit is contained in:
Ali
2020-11-15 20:42:55 +04:00
parent bd1a625db0
commit b003339efd
2 changed files with 13 additions and 1 deletions

View File

@@ -69,6 +69,18 @@ public enum ContainedViewLayoutTransition {
}
}
public extension CGRect {
var ensuredValid: CGRect {
if !ASIsCGRectValidForLayout(CGRect(origin: CGPoint(), size: self.size)) {
return CGRect()
}
if !ASIsCGPositionValidForLayout(self.origin) {
return CGRect()
}
return self
}
}
public extension ContainedViewLayoutTransition {
func updateFrame(node: ASDisplayNode, frame: CGRect, force: Bool = false, beginWithCurrentState: Bool = false, delay: Double = 0.0, completion: ((Bool) -> Void)? = nil) {
if frame.origin.x.isNaN {