• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why CGPathAddCurveToPoint returns to the origin?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Why CGPathAddCurveToPoint returns to the origin?
      • From: David Duncan <email@hidden>
References: 
 >Why CGPathAddCurveToPoint returns to the origin? (From: Gustavo Pizano <email@hidden>)
 >Re: Why CGPathAddCurveToPoint returns to the origin? (From: Gustavo Pizano <email@hidden>)

  • Prev by Date: Re: Why CGPathAddCurveToPoint returns to the origin?
  • Next by Date: Re: How a window was closed?
  • Previous by thread: Re: Why CGPathAddCurveToPoint returns to the origin?
  • Next by thread: Re: Why CGPathAddCurveToPoint returns to the origin?
  • Index(es):
    • Date
    • Thread