mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
Another fix
This commit is contained in:
parent
bd1a625db0
commit
b003339efd
@ -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 {
|
||||
|
@ -680,7 +680,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTransitio
|
||||
|
||||
let arguments = TransformImageArguments(corners: corners, imageSize: drawingSize, boundingSize: boundingSize, intrinsicInsets: UIEdgeInsets(), resizeMode: isInlinePlayableVideo ? .fill(.black) : .blurBackground, emptyColor: emptyColor, custom: patternArguments)
|
||||
|
||||
let imageFrame = CGRect(origin: CGPoint(x: -arguments.insets.left, y: -arguments.insets.top), size: arguments.drawingSize)
|
||||
let imageFrame = CGRect(origin: CGPoint(x: -arguments.insets.left, y: -arguments.insets.top), size: arguments.drawingSize).ensuredValid
|
||||
|
||||
let imageApply = imageLayout(arguments)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user