Add CHANGELOG entry and end image context

This commit is contained in:
Steven Deutsch
2017-11-10 20:48:35 -06:00
parent f1e5b31eae
commit 89f8993cae
2 changed files with 6 additions and 2 deletions
+3
View File
@@ -12,6 +12,9 @@ The changelog for `MessageKit`. Also see the [releases](https://github.com/Messa
origin Y so that the `cellBottomLabel` is always under the `MessageContainerView`.
[#326](https://github.com/MessageKit/MessageKit/pull/326) by [@SD10](https://github.com/sd10).
- Fixed pixelation of `AvatarView`'s placeholder text initials.
[#343](https://github.com/MessageKit/MessageKit/pull/343) by [@johnnyoin](https://github.com/johnnyoin).
## [[Prerelease] 0.10.1](https://github.com/MessageKit/MessageKit/releases/tag/0.10.1)
### Fixed
+3 -2
View File
@@ -89,7 +89,8 @@ open class AvatarView: UIView {
if width == 0 || height == 0 {return UIImage()}
var font = placeholderFont
_ = UIGraphicsBeginImageContextWithOptions(CGSize(width: width, height: height), false, UIScreen.main.scale)
_ = UIGraphicsBeginImageContextWithOptions(CGSize(width: width, height: height), false, UIScreen.main.scale)
defer { UIGraphicsEndImageContext() }
let context = UIGraphicsGetCurrentContext()!
//// Text Drawing
@@ -102,7 +103,7 @@ open class AvatarView: UIView {
let textStyle = NSMutableParagraphStyle()
textStyle.alignment = .center
let textFontAttributes: [NSAttributedStringKey: Any] = [NSAttributedStringKey.font: font, NSAttributedStringKey.foregroundColor: placeholderTextColor, NSAttributedStringKey.paragraphStyle: textStyle]
let textFontAttributes: [NSAttributedStringKey: Any] = [NSAttributedStringKey.font: font, NSAttributedStringKey.foregroundColor: placeholderTextColor, NSAttributedStringKey.paragraphStyle: textStyle]
let textTextHeight: CGFloat = initals.boundingRect(with: CGSize(width: textRect.width, height: CGFloat.infinity), options: .usesLineFragmentOrigin, attributes: textFontAttributes, context: nil).height
context.saveGState()