Re: Why CGPathAddCurveToPoint returns to the origin?
Re: Why CGPathAddCurveToPoint returns to the origin?
- Subject: Re: Why CGPathAddCurveToPoint returns to the origin?
- From: Gustavo Pizano <email@hidden>
- Date: Fri, 5 Mar 2010 14:45:29 +0100
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?
G.
On Mar 5, 2010, at 2:39 PM, Gustavo Pizano wrote:
> OOP sorry I messed up with the points\
>
> :P
>
> On Mar 5, 2010, at 2:34 PM, Gustavo Pizano wrote:
>
>> 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