Re: Why CGPathAddCurveToPoint returns to the origin?
Re: Why CGPathAddCurveToPoint returns to the origin?
- Subject: Re: Why CGPathAddCurveToPoint returns to the origin?
- From: David Duncan <email@hidden>
- Date: Fri, 5 Mar 2010 09:46:51 -0800
On Mar 5, 2010, at 5:45 AM, Gustavo Pizano wrote:
> EHH nop sorry, I fixed and still I get the nice flower..
> CGContextBeginPath(currentContext);
>
> CGContextMoveToPoint(currentContext,midX,minY);
> CGContextAddCurveToPoint(currentContext, maxX , minY, maxX, midY , 2.0f, 2.0f);
> CGContextAddCurveToPoint(currentContext, maxX, maxY, midX, maxY, 2.0f, 2.0f);
> CGContextAddCurveToPoint(currentContext,minX , maxY, minX, midY, 2.0f, 2.0f);
> CGContextAddCurveToPoint(currentContext, minX, minY, midX,minY, 2.0f, 2.0f);
>
> CGContextClosePath(currentContext);
>
> CGContextClip(currentContext);
> .....
> Any ideas?
First off, what are you trying to draw?
The reason why you are getting a nice flower-ish pattern is because you are asking all of your curves to trace through 2 points and end at the same location (2,2). CGContextAddCurveToPoint generate a bezier curve that starts at the current location, approaches the 2 control points (which are your various combinations of min/mid/max x/y) and ends at the end point (which is always 2,2).
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden