Revert "Merge pull request #122 from AntonPalich/Fix_text_size_calculation"
This reverts commit06655cdd77, reversing changes made toacc9900c98.
This commit is contained in:
parent
06655cdd77
commit
47f6692eca
|
|
@ -234,14 +234,11 @@ private final class TextBubbleLayoutModel {
|
|||
}
|
||||
|
||||
private func textSizeThatFitsWidth(width: CGFloat) -> CGSize {
|
||||
let maxSize = CGSize(width: width, height: CGFloat.max)
|
||||
let options: NSStringDrawingOptions = [.UsesLineFragmentOrigin, .UsesFontLeading]
|
||||
let attributes = [NSFontAttributeName: self.layoutContext.font]
|
||||
var size = self.layoutContext.text.boundingRectWithSize(maxSize, options: options, attributes: attributes, context: nil).size.bma_round()
|
||||
// Added to prevent: https://github.com/badoo/Chatto/issues/121
|
||||
size.width += 1
|
||||
size.height += 1
|
||||
return size
|
||||
return self.layoutContext.text.boundingRectWithSize(
|
||||
CGSize(width: width, height: CGFloat.max),
|
||||
options: [.UsesLineFragmentOrigin, .UsesFontLeading],
|
||||
attributes: [NSFontAttributeName: self.layoutContext.font], context: nil
|
||||
).size.bma_round()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue