Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (CGRect)addPathPreviousPreviousPoint:(CGPoint)p2Point withPreviousPoint:(CGPoint)p1Point withCurrentPoint:(CGPoint)cpoint {
- CGPoint mid1 = midPoint(p1Point, p2Point);
- CGPoint mid2 = midPoint(cpoint, p1Point);
- CGMutablePathRef subpath = CGPathCreateMutable();
- CGPathMoveToPoint(subpath, NULL, mid1.x, mid1.y);
- CGPathAddQuadCurveToPoint(subpath, NULL, p1Point.x, p1Point.y, mid2.x, mid2.y);
- CGRect bounds = CGPathGetBoundingBox(subpath);
- CGPathAddPath(path, NULL, subpath);
- CGPathRelease(subpath);
- return bounds;
- }
- - (void)draw
- {
- CGContextRef context = UIGraphicsGetCurrentContext();
- CGContextAddPath(context, path);
- CGContextSetLineCap(context, kCGLineCapRound);
- CGContextSetLineWidth(context, self.lineWidth);
- CGContextSetStrokeColorWithColor(context, self.lineColor.CGColor);
- CGContextSetBlendMode(context, kCGBlendModeNormal);
- CGContextSetAlpha(context, self.lineAlpha);
- CGContextStrokePath(context);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement