Fix avatar background composition
This commit is contained in:
parent
5060d73d0d
commit
6f962ecb42
|
@ -15,7 +15,6 @@ final class MasterTimelineAvatarView: UIView {
|
|||
if image !== oldValue {
|
||||
imageView.image = image
|
||||
setNeedsLayout()
|
||||
setNeedsDisplay()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,21 +45,17 @@ final class MasterTimelineAvatarView: UIView {
|
|||
|
||||
override func didMoveToSuperview() {
|
||||
setNeedsLayout()
|
||||
setNeedsDisplay()
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
imageView.setFrameIfNotEqual(rectForImageView())
|
||||
if hasExposedVerticalBackground {
|
||||
backgroundColor = AppAssets.avatarBackgroundColor
|
||||
} else {
|
||||
backgroundColor = nil
|
||||
}
|
||||
}
|
||||
|
||||
override func draw(_ dirtyRect: CGRect) {
|
||||
if hasExposedVerticalBackground {
|
||||
AppAssets.avatarBackgroundColor.set()
|
||||
} else {
|
||||
UIColor.systemBackground.set()
|
||||
}
|
||||
UIRectFill(dirtyRect)
|
||||
}
|
||||
}
|
||||
|
||||
private extension MasterTimelineAvatarView {
|
||||
|
|
Loading…
Reference in New Issue