Emoji input and display in media selection

This commit is contained in:
Ali
2022-07-15 14:49:48 +02:00
parent 0577baac79
commit eaf0b74f1b
18 changed files with 829 additions and 250 deletions

View File

@@ -118,7 +118,7 @@ public final class TextNodeWithEntities {
if let font = string.attribute(.font, at: range.location, effectiveRange: nil) as? UIFont {
string.addAttribute(NSAttributedString.Key("Attribute__EmbeddedItem"), value: InlineStickerItem(emoji: value, file: value.file, fontSize: font.pointSize), range: range)
let itemSize = font.pointSize * 24.0 / 17.0 / CGFloat(range.length)
let itemSize = font.pointSize * 24.0 / 17.0 / CGFloat(min(2, range.length))
let runDelegateData = RunDelegateData(
ascent: font.ascender,