Revert "Merge pull request #122 from AntonPalich/Fix_text_size_calculation"

This reverts commit 06655cdd77, reversing
changes made to acc9900c98.
This commit is contained in:
Anton Schukin 2016-05-05 16:33:01 +01:00
parent 06655cdd77
commit 47f6692eca
1 changed files with 5 additions and 8 deletions

View File

@ -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()
}
}