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:
Ron Davis 2018-07-05 09:49:18 -05:00
parent f0c5b44c65
commit 864d123aa1
1 changed files with 2 additions and 1 deletions

View File

@ -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()