Skip to content

Commit

Permalink
Merge pull request #19 from DisobedientMedia/hide-units
Browse files Browse the repository at this point in the history
Hide scale units with optional showScale attribute
  • Loading branch information
will-tm committed Aug 11, 2014
2 parents 423848f + 816ae96 commit 44b43ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions WMGaugeView/WMGaugeView.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ WMGaugeViewInnerBackgroundStyle;
@property (nonatomic, readwrite, assign) CGFloat scaleDivisions;
@property (nonatomic, readwrite, assign) CGFloat scaleSubdivisions;
@property (nonatomic, readwrite, assign) bool showScaleShadow;
@property (nonatomic, readwrite, assign) bool showScale;
@property (nonatomic, readwrite, assign) WMGaugeViewSubdivisionsAlignment scalesubdivisionsAligment;
@property (nonatomic, readwrite, assign) CGFloat scaleDivisionsLength;
@property (nonatomic, readwrite, assign) CGFloat scaleDivisionsWidth;
Expand Down
9 changes: 8 additions & 1 deletion WMGaugeView/WMGaugeView.m
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ - (void)drawGauge:(CGContextRef)context
if (_showUnitOfMeasurement)
[self drawText:context];

[self drawScale:context];
if (_showScale)
[self drawScale:context];

if (_showRangeLabels)
[self drawRangeLabels:context];
Expand Down Expand Up @@ -879,6 +880,12 @@ - (void)setShowScaleShadow:(bool)showScaleShadow
[self invalidateBackground];
}

- (void)setShowScale:(bool)showScale
{
_showScale = showScale;
[self invalidateBackground];
}

- (void)setScalesubdivisionsAligment:(WMGaugeViewSubdivisionsAlignment)scalesubdivisionsAligment
{
_scalesubdivisionsAligment = scalesubdivisionsAligment;
Expand Down

0 comments on commit 44b43ce

Please sign in to comment.