Fix: truncate pills if they are too long

This commit is contained in:
Nicolas Mauri
2023-03-23 12:25:51 +01:00
parent 6c2e55ad93
commit db3c399e8e
5 changed files with 22 additions and 7 deletions
@@ -42,11 +42,15 @@ import UIKit
return
}
guard let pillData = textAttachment.data else {
guard var pillData = textAttachment.data else {
MXLog.debug("[PillAttachmentViewProvider]: attachment misses pill data")
return
}
if let messageTextView {
pillData.maxWidth = messageTextView.bounds.width - 8
}
let mainSession = AppDelegate.theDelegate().mxSessions.first as? MXSession
let pillView = PillAttachmentView(frame: CGRect(origin: .zero, size: textAttachment.size(forFont: pillData.font)),