mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-31 23:47:01 +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
|
||||
}
|
||||
|
||||
let statusInText = !isImage
|
||||
var statusInText = !isImage
|
||||
if let textString {
|
||||
if textString.length == 0 {
|
||||
statusInText = false
|
||||
}
|
||||
} else {
|
||||
statusInText = false
|
||||
}
|
||||
|
||||
switch preparePosition {
|
||||
case .linear(_, .None), .linear(_, .Neighbour(true, _, _)):
|
||||
|
@ -893,7 +893,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTransitio
|
||||
|
||||
return (resultWidth, { boundingWidth in
|
||||
var boundingSize: CGSize
|
||||
let drawingSize: CGSize
|
||||
var drawingSize: CGSize
|
||||
|
||||
switch sizeCalculation {
|
||||
case .constrained:
|
||||
@ -918,6 +918,9 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTransitio
|
||||
case .aspectFill:
|
||||
drawingSize = nativeSize.aspectFilled(boundingSize)
|
||||
}
|
||||
if additionalWidthConstrainment {
|
||||
drawingSize.height = drawingSize.width * (1920.0 / 1080.0)
|
||||
}
|
||||
}
|
||||
case .unconstrained:
|
||||
boundingSize = constrainedSize
|
||||
|
Loading…
x
Reference in New Issue
Block a user