Fix avatar background composition

This commit is contained in:
Maurice Parker 2019-09-19 13:41:07 -05:00
parent 5060d73d0d
commit 6f962ecb42
1 changed files with 5 additions and 10 deletions

View File

@ -15,7 +15,6 @@ final class MasterTimelineAvatarView: UIView {
if image !== oldValue { if image !== oldValue {
imageView.image = image imageView.image = image
setNeedsLayout() setNeedsLayout()
setNeedsDisplay()
} }
} }
} }
@ -46,21 +45,17 @@ final class MasterTimelineAvatarView: UIView {
override func didMoveToSuperview() { override func didMoveToSuperview() {
setNeedsLayout() setNeedsLayout()
setNeedsDisplay()
} }
override func layoutSubviews() { override func layoutSubviews() {
imageView.setFrameIfNotEqual(rectForImageView()) 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 { private extension MasterTimelineAvatarView {