What’s the problem in my code, cause when I’m doing a new point. The previous point is automatically made a new straight line that’s connected to my current point.
here’s my code
UIGraphicsBeginImageContext(CGSizeMake(480 , 320));
[drawView.image drawInRect:CGRectMake(0, 0, 480,320)];
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineCap(context,kCGLineCapRound);
CGContextSetLineWidth(context, 5);
CGContextSetRGBStrokeColor(context,red, green, blue, 1.0);
CGContextMoveToPoint(context, mid1.x, mid1.y);
CGContextAddQuadCurveToPoint(context, previousPoint1.x, previousPoint1.y, mid2.x, mid2.y);
CGContextStrokePath(context);
drawView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsGetCurrentContext();
What your code performs is drawing a a quadratic bézier curve going from mid1 to mid2 passing by previousPoint.
According to your variables names I guess that you either misused tAddQuadCurveToPoint by confusing the variables, either you have previousPoint1, mid1 and mid2 on the same line and so don’t see anything else than a line.