Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios

This commit is contained in:
Ilya Laktyushin
2021-07-18 00:22:45 +03:00
21 changed files with 1702 additions and 49 deletions

View File

@@ -1025,7 +1025,14 @@ public class TextNode: ASDisplayNode {
layoutSize.height += fontLineSpacing
}
let lineRange = CFRangeMake(lastLineCharacterIndex, lineCharacterCount)
var lineRange = CFRangeMake(lastLineCharacterIndex, lineCharacterCount)
if lineRange.location + lineRange.length > attributedString.length {
lineRange.length = attributedString.length - lineRange.location
}
if lineRange.length < 0 {
break
}
let coreTextLine = CTTypesetterCreateLineWithOffset(typesetter, lineRange, 100.0)
lastLineCharacterIndex += lineCharacterCount