Fix avatar background composition
This commit is contained in:
parent
5060d73d0d
commit
6f962ecb42
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue