mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Another fix
This commit is contained in:
parent
bd1a625db0
commit
b003339efd
2 changed files with 13 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue