[Fixed] Emoji 2x sizing bug

This commit is contained in:
Steven Deutsch
2017-10-05 22:04:27 -05:00
parent 573868a0d5
commit a48b7648d2
2 changed files with 8 additions and 5 deletions
@@ -131,7 +131,13 @@ open class MessagesCollectionViewFlowLayout: UICollectionViewFlowLayout {
attributes.cellBottomLabelFrame = CGRect(origin: .zero, size: cellBottomLabelSize(for: message, at: indexPath))
attributes.avatarFrame = CGRect(origin: .zero, size: avatarSize(for: message, at: indexPath))
attributes.messageLabelFont = messageLabelFont
switch message.data {
case .emoji:
attributes.messageLabelFont = emojiLabelFont
default:
attributes.messageLabelFont = messageLabelFont
}
attributes.messagePadding = messagePadding
attributes.messageLabelInsets = messageInsets
attributes.cellTopLabelInsets = topLabelInsets
+1 -4
View File
@@ -68,13 +68,10 @@ open class TextMessageCell: MessageCollectionViewCell<MessageLabel> {
}
switch message.data {
case .text(let text):
case .text(let text), .emoji(let text):
messageContentView.text = text
case .attributedText(let text):
messageContentView.attributedText = text
case .emoji(let text):
messageContentView.text = text
messageContentView.font = messageContentView.font.withSize(2 * messageContentView.font.pointSize)
default:
break
}