• 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: Drawing after CGContextClosePath() still appends line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Drawing after CGContextClosePath() still appends line


  • Subject: Re: Drawing after CGContextClosePath() still appends line
  • From: Roland King <email@hidden>
  • Date: Tue, 20 Aug 2013 08:25:04 +0800

On 20 Aug, 2013, at 8:03 AM, Rick Mann <email@hidden> wrote:

> I'm drawing a couple of arcs and then calling ClosePath() to close up the shape I drew. This works great. But then I repeat the process in a different place, and stroke the whole thing. Unfortunately, Core Graphics adds a line from the last point in the closed path to the first point of the new arc I add. From my reading of the docs, this line shouldn't happen.
>
> "After closing the subpath, your application can begin a new subpath without first calling CGContextMoveToPoint. In this case, a new subpath is implicitly created with a starting and current point equal to the previous subpath’s starting point."
>

From my reading that's exactly what should happen. You close the subpath then you implicitly start one because you didn't call CGContextMoveToPoint() when you add the next arc, that path starts from the original starting point of the old subpath (which is functionally exactly the same as the endpoint). So the new subpath starts with a line to the start of your new arc from the start of the previous path. If you don't want that, do the move.

There's a difference between a context with no path at all and a context which already contains subpaths, closed or not.


_______________________________________________

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: Drawing after CGContextClosePath() still appends line
      • From: Rick Mann <email@hidden>
References: 
 >Drawing after CGContextClosePath() still appends line (From: Rick Mann <email@hidden>)

  • Prev by Date: Drawing after CGContextClosePath() still appends line
  • Next by Date: Re: Drawing after CGContextClosePath() still appends line
  • Previous by thread: Drawing after CGContextClosePath() still appends line
  • Next by thread: Re: Drawing after CGContextClosePath() still appends line
  • Index(es):
    • Date
    • Thread