Why CGPathAddCurveToPoint returns to the origin?
Why CGPathAddCurveToPoint returns to the origin?
- Subject: Why CGPathAddCurveToPoint returns to the origin?
- From: Gustavo Pizano <email@hidden>
- Date: Fri, 5 Mar 2010 14:34:38 +0100
Hello.
I have the following code:
......
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path,NULL,midX,minY);
CGPathAddCurveToPoint(path,NULL, maxX , minY, maxX, midY , 2.0f, 2.0f);
CGPathAddCurveToPoint(path,NULL, maxX, maxY, midX, maxY, 2.0f, 2.0f);
CGPathAddCurveToPoint(path,NULL,minX , maxY, minX, midY, 2.0f, 2.0f);
CGPathAddCurveToPoint(path,NULL, minX, minX, midX,minY, 2.0f, 2.0f);
CGPathCloseSubpath(path);
CGContextAddPath(currentContext, path);
CGContextClip(currentContext);
CGContextDrawLinearGradient(currentContext, glossGradient, topCenter, bottonCenter, 0);
CGPathRelease(path);
this code works on Cocoa, but on iPHone it doesn't, It goes to the starting point, and after the first curve, it returns to the origin, and for there adds the second curve and after that it returns to origin again and so on.
So at the end I have a very nice "flower" which is what I don't what I just want a rounded corners rect, what can I be doing wrong?
Thanks
Gustavo
_______________________________________________
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