Skip to content

Commit ed51f05

Browse files
authored
Merge pull request #489 from Adamant-im/dev/trello.com/c/eNshyP4R
[trello.com/c/eNshyP4R] Fixed: Wrong message height
2 parents faa0227 + b2711d4 commit ed51f05

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Adamant/Modules/Chat/View/Managers/FixedTextMessageSizeCalculator.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,15 @@
127127
let textContainer = NSTextContainer(
128128
size: CGSize(width: maxWidth, height: .greatestFiniteMagnitude)
129129
)
130+
textContainer.lineFragmentPadding = .zero
131+
130132
let layoutManager = NSLayoutManager()
131133

132134
layoutManager.addTextContainer(textContainer)
133135

134136
let textStorage = NSTextStorage(attributedString: attributedText)
135137
textStorage.addLayoutManager(layoutManager)
136138

137-
let range = NSRange(location: 0, length: attributedText.length)
138139
let rect = layoutManager.usedRect(for: textContainer)
139140

140141
return rect.integral.size
@@ -170,5 +171,5 @@
170171
private let messageLabelFont = UIFont.preferredFont(forTextStyle: .body)
171172

172173
/// Additional width to fix incorrect size calculating
173-
private let additionalWidth: CGFloat = 5
174+
private let additionalWidth: CGFloat = 5
174175
private let additionalHeight: CGFloat = 5

0 commit comments

Comments
 (0)