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:
@@ -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