Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Draws linear lines with <= 2 points
Browse files Browse the repository at this point in the history
Fixes #233 by checking for data sources with less than two data points
and drawing an appropriate line and line fill.
  • Loading branch information
Sam Spencer committed Jan 24, 2016
1 parent 30347ca commit aa51b11
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Classes/BEMLine.m
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,14 @@ - (void)drawRect:(CGRect)rect {
}
}

if (!self.disableMainLine && self.bezierCurveIsEnabled) {
BOOL bezierStatus = self.bezierCurveIsEnabled;
if (self.arrayOfPoints.count <= 2 && self.bezierCurveIsEnabled == YES) bezierStatus = NO;

if (!self.disableMainLine && bezierStatus) {
line = [BEMLine quadCurvedPathWithPoints:self.points];
fillBottom = [BEMLine quadCurvedPathWithPoints:self.bottomPointsArray];
fillTop = [BEMLine quadCurvedPathWithPoints:self.topPointsArray];
} else if (!self.disableMainLine && !self.bezierCurveIsEnabled) {
} else if (!self.disableMainLine && !bezierStatus) {
line = [BEMLine linesToPoints:self.points];
fillBottom = [BEMLine linesToPoints:self.bottomPointsArray];
fillTop = [BEMLine linesToPoints:self.topPointsArray];
Expand Down

0 comments on commit aa51b11

Please sign in to comment.