Skip to content

Commit

Permalink
Added a lineWidth property on MBRoundProgressView.
Browse files Browse the repository at this point in the history
  • Loading branch information
Baldoph committed Nov 5, 2018
1 parent 202d889 commit 95dee73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions MBProgressHUD.h
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ NS_ASSUME_NONNULL_BEGIN
*/
@property (nonatomic, strong) UIColor *backgroundTintColor;

/**
* Indicator line width.
* Defaults to 2.0.
*/
@property (nonatomic, assign) CGFloat lineWidth;

/*
* Display mode - NO = round or YES = annular. Defaults to round.
*/
Expand Down
5 changes: 3 additions & 2 deletions MBProgressHUD.m
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ - (id)initWithFrame:(CGRect)frame {
_annular = NO;
_progressTintColor = [[UIColor alloc] initWithWhite:1.f alpha:1.f];
_backgroundTintColor = [[UIColor alloc] initWithWhite:1.f alpha:.1f];
_lineWidth = 2;
}
return self;
}
Expand Down Expand Up @@ -854,7 +855,7 @@ - (void)drawRect:(CGRect)rect {

if (_annular) {
// Draw background
CGFloat lineWidth = 2.f;
CGFloat lineWidth = _lineWidth;
UIBezierPath *processBackgroundPath = [UIBezierPath bezierPath];
processBackgroundPath.lineWidth = lineWidth;
processBackgroundPath.lineCapStyle = kCGLineCapButt;
Expand All @@ -875,7 +876,7 @@ - (void)drawRect:(CGRect)rect {
[processPath stroke];
} else {
// Draw background
CGFloat lineWidth = 2.f;
CGFloat lineWidth = _lineWidth;
CGRect allRect = self.bounds;
CGRect circleRect = CGRectInset(allRect, lineWidth/2.f, lineWidth/2.f);
CGPoint center = CGPointMake(CGRectGetMidX(self.bounds), CGRectGetMidY(self.bounds));
Expand Down

0 comments on commit 95dee73

Please sign in to comment.