diff --git a/Session/Utilities/MentionUtilities.swift b/Session/Utilities/MentionUtilities.swift index 26d1fc05f..950076462 100644 --- a/Session/Utilities/MentionUtilities.swift +++ b/Session/Utilities/MentionUtilities.swift @@ -115,6 +115,7 @@ public enum MentionUtilities { result.addAttribute(.currentUserMentionBackgroundCornerRadius, value: (8 * sizeDiff), range: mention.range) result.addAttribute(.currentUserMentionBackgroundPadding, value: (3 * sizeDiff), range: mention.range) result.addAttribute(.currentUserMentionBackgroundColor, value: primaryColor.color, range: mention.range) + result.addAttribute(.kern, value: (3 * sizeDiff), range: NSRange(location: mention.range.upperBound, length: 1)) } switch (location, mention.isCurrentUser, theme.interfaceStyle) { diff --git a/SessionUIKit/Components/HighlightMentionBackgroundView.swift b/SessionUIKit/Components/HighlightMentionBackgroundView.swift index 289787c21..88076382a 100644 --- a/SessionUIKit/Components/HighlightMentionBackgroundView.swift +++ b/SessionUIKit/Components/HighlightMentionBackgroundView.swift @@ -85,6 +85,10 @@ public class HighlightMentionBackgroundView: UIView { var origins = [CGPoint](repeating: .zero, count: lines.count) CTFrameGetLineOrigins(frame, CFRangeMake(0, 0), &origins) + + var currentMentionBounds: CGRect? = nil // Store mention bounding box + var lastMentionBackgroundColor: UIColor = .clear + var lastMentionBackgroundCornerRadius: CGFloat = 0 for lineIndex in 0..