mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-10 08:20:16 +00:00
TextNode width extension fix
This commit is contained in:
parent
9a84348e22
commit
bacdfcc6af
@ -475,7 +475,14 @@ public class TextNode: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !lines.isEmpty && bottomCutoutEnabled {
|
if !lines.isEmpty && bottomCutoutEnabled {
|
||||||
layoutSize.width = max(layoutSize.width, lines[lines.count - 1].frame.width + bottomCutoutSize.width)
|
let proposedWidth = lines[lines.count - 1].frame.width + bottomCutoutSize.width
|
||||||
|
if proposedWidth > layoutSize.width {
|
||||||
|
if proposedWidth < constrainedSize.width {
|
||||||
|
layoutSize.width = proposedWidth
|
||||||
|
} else {
|
||||||
|
layoutSize.height += bottomCutoutSize.height
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TextNodeLayout(attributedString: attributedString, maximumNumberOfLines: maximumNumberOfLines, truncationType: truncationType, constrainedSize: constrainedSize, alignment: alignment, lineSpacing: lineSpacingFactor, cutout: cutout, insets: insets, size: CGSize(width: ceil(layoutSize.width) + insets.left + insets.right, height: ceil(layoutSize.height) + insets.top + insets.bottom), firstLineOffset: firstLineOffset, lines: lines, backgroundColor: backgroundColor)
|
return TextNodeLayout(attributedString: attributedString, maximumNumberOfLines: maximumNumberOfLines, truncationType: truncationType, constrainedSize: constrainedSize, alignment: alignment, lineSpacing: lineSpacingFactor, cutout: cutout, insets: insets, size: CGSize(width: ceil(layoutSize.width) + insets.left + insets.right, height: ceil(layoutSize.height) + insets.top + insets.bottom), firstLineOffset: firstLineOffset, lines: lines, backgroundColor: backgroundColor)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user