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 {
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 {