• 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
Why CGPathAddCurveToPoint returns to the origin?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Why CGPathAddCurveToPoint returns to the origin?
      • From: Gustavo Pizano <email@hidden>
  • Prev by Date: Re: Converting a Cocoa Application project to a document-based one
  • Next by Date: Re: Why CGPathAddCurveToPoint returns to the origin?
  • Previous by thread: Re: NSOutlineView style issue.
  • Next by thread: Re: Why CGPathAddCurveToPoint returns to the origin?
  • Index(es):
    • Date
    • Thread