Various fixes

This commit is contained in:
Ilya Laktyushin
2023-02-23 23:49:04 +04:00
parent 8188bc2858
commit 4c500ce3b2
17 changed files with 107 additions and 2098 deletions

View File

@@ -1514,7 +1514,7 @@ open class TextNode: ASDisplayNode {
if glyphCount == 2, let font = attributes["NSFont"] as? UIFont, font.fontName.contains("ColorEmoji"), let string = layout.attributedString {
let range = CTRunGetStringRange(run)
if range.location < string.length && (range.location + range.length) < string.length {
if range.location < string.length && (range.location + range.length) <= string.length {
let substring = string.attributedSubstring(from: NSMakeRange(range.location, range.length)).string
let heart = Unicode.Scalar(0x2764)!