This commit is contained in:
Ali 2023-07-18 17:46:39 +04:00
parent 1adee04eae
commit 63edb12edf

View File

@ -1260,7 +1260,12 @@ open class TextNode: ASDisplayNode {
var effectiveLineRange = brokenLineRange var effectiveLineRange = brokenLineRange
var additionalTrailingLine: (CTLine, Double)? var additionalTrailingLine: (CTLine, Double)?
if lineRange.length == 0 || (CTLineGetTypographicBounds(originalLine, nil, nil, nil) - CTLineGetTrailingWhitespaceWidth(originalLine) + truncationTokenWidth) < Double(lineConstrainedSize.width) { var measureFitWidth = CTLineGetTypographicBounds(originalLine, nil, nil, nil) - CTLineGetTrailingWhitespaceWidth(originalLine)
if customTruncationToken != nil {
measureFitWidth += truncationTokenWidth
}
if lineRange.length == 0 || measureFitWidth < Double(lineConstrainedSize.width) {
if didClipLinebreak { if didClipLinebreak {
if lineRange.length == 0 { if lineRange.length == 0 {
coreTextLine = CTLineCreateWithAttributedString(NSAttributedString()) coreTextLine = CTLineCreateWithAttributedString(NSAttributedString())