Skip to content

Commit

Permalink
fix: fix a indicator UI update issue
Browse files Browse the repository at this point in the history
  • Loading branch information
guoyingtao committed Jun 21, 2023
1 parent a8e45e4 commit f5e049a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Inchworm/Source/ProcessIndicatorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,11 @@ class ProcessIndicatorView: UIView {
private func setProgress(ratio progressRatio: Float, value progressValue: Int) {
status = .editingSelf

progressLayer.strokeEnd = 0

if progressRatio > 0 {
minusProgressLayer.strokeEnd = 0
progressLayer.isHidden = false
minusProgressLayer.isHidden = true

progressLayer.path = circlePath.cgPath
progressColor = UIColor(displayP3Red: 247.0 / 255.0, green: 198.0 / 255.0, blue: 0, alpha: 1)
Expand All @@ -234,7 +236,7 @@ class ProcessIndicatorView: UIView {
progressLayer.strokeEnd = abs(CGFloat(progressRatio))
progressNumberLayer.foregroundColor = progressColor.cgColor
} else {
progressLayer.isHidden = true
progressLayer.strokeEnd = 0
minusProgressLayer.isHidden = false

minusProgressColor = .white
Expand Down

0 comments on commit f5e049a

Please sign in to comment.