mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Add CHANGELOG entry and end image context
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user