Made the levelFill layer a sub-layer of the bodyOutline layer and then click the mask to avoid ever showing the fill layer outside of the outline.
This commit is contained in:
parent
f0c5b44c65
commit
864d123aa1
|
@ -79,8 +79,9 @@ open class BatteryView: UIView {
|
|||
private var levelFill = CALayer()
|
||||
|
||||
private func setUp() {
|
||||
layer.addSublayer(levelFill)
|
||||
layer.addSublayer(bodyOutline)
|
||||
bodyOutline.masksToBounds = true
|
||||
bodyOutline.addSublayer(levelFill)
|
||||
layer.addSublayer(terminalOutline)
|
||||
layer.addSublayer(terminalOpening)
|
||||
setNeedsLayout()
|
||||
|
|
Loading…
Reference in New Issue