Skip to content

Commit 10c375f

Browse files
author
Dan Morrow
committed
changed “drawRect” so that if self.progress is 0, then we set the path of _progressLayer to nil. This will effectively “erase” progress. This is useful if M13ProgressViewBar is used in a reusable view, like a UITableViewCell.
1 parent e2df6b6 commit 10c375f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Classes/ProgressViews/M13ProgressViewBar.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,8 @@ - (void)drawRect:(CGRect)rect
615615
[path addLineToPoint:CGPointMake(_progressBarThickness / 2.0, _progressLayer.frame.size.height * self.progress)];
616616
[_progressLayer setPath:path.CGPath];
617617
}
618+
} else {
619+
[_progressLayer setPath:nil];
618620
}
619621
}
620622

0 commit comments

Comments
 (0)