mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Fix link preview layout
This commit is contained in:
parent
4c8f8132c0
commit
4ca0e55d15
@ -526,11 +526,18 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if preferMediaBeforeText {
|
if preferMediaBeforeText, let textString, textString.length != 0 {
|
||||||
isImage = false
|
isImage = false
|
||||||
}
|
}
|
||||||
|
|
||||||
let statusInText = !isImage
|
var statusInText = !isImage
|
||||||
|
if let textString {
|
||||||
|
if textString.length == 0 {
|
||||||
|
statusInText = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
statusInText = false
|
||||||
|
}
|
||||||
|
|
||||||
switch preparePosition {
|
switch preparePosition {
|
||||||
case .linear(_, .None), .linear(_, .Neighbour(true, _, _)):
|
case .linear(_, .None), .linear(_, .Neighbour(true, _, _)):
|
||||||
|
@ -893,7 +893,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTransitio
|
|||||||
|
|
||||||
return (resultWidth, { boundingWidth in
|
return (resultWidth, { boundingWidth in
|
||||||
var boundingSize: CGSize
|
var boundingSize: CGSize
|
||||||
let drawingSize: CGSize
|
var drawingSize: CGSize
|
||||||
|
|
||||||
switch sizeCalculation {
|
switch sizeCalculation {
|
||||||
case .constrained:
|
case .constrained:
|
||||||
@ -918,6 +918,9 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTransitio
|
|||||||
case .aspectFill:
|
case .aspectFill:
|
||||||
drawingSize = nativeSize.aspectFilled(boundingSize)
|
drawingSize = nativeSize.aspectFilled(boundingSize)
|
||||||
}
|
}
|
||||||
|
if additionalWidthConstrainment {
|
||||||
|
drawingSize.height = drawingSize.width * (1920.0 / 1080.0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case .unconstrained:
|
case .unconstrained:
|
||||||
boundingSize = constrainedSize
|
boundingSize = constrainedSize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user