• 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
How to get the stroke geometry of a NSBezierPath?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get the stroke geometry of a NSBezierPath?


  • Subject: How to get the stroke geometry of a NSBezierPath?
  • From: Jesse Grosjean <email@hidden>
  • Date: Sun, 4 Feb 2007 17:56:25 -0500

I'm trying to find the point where a given line intersects a NSBezierPath, and I'd like to also include the paths current stroke in this calculation. I know how to do it without taking the stroke into consideration by using [NSBezierPath-OAExtensions intersectionWithLine:lineStart:lineEnd:] from the Omni frameworks, but that method ignores the paths current stroke.

I think the easiest way to solve this is to find a way to turn the path's stroke into a path itself, and then just use the same test on that path. (if there's a better way please let me know) And so that lead to my question, how can I get and access the stroke geometry from a NSBezierPath.

I feel like I'm close, but I'm stuck at the very end. Right now I'm:

1. Turning my NSBezierPath into a CGPathRef.
2. Adding that CGPathRef to a CGContext.
3. Calling CGContextReplacePathWithStrokedPath to replace the current path in the context with a path representing it's stroke...


If I'm understanding things correctly then I think that means that path that I want is sitting there in the CGContext, but I can't seem to find any API that will let me iterate over it's path elements. Does anyone know how to get the geometry of the current path from a CGContext?

Thanks,
Jesse
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: How to get the stroke geometry of a NSBezierPath?
      • From: Mark Onyschuk <email@hidden>
  • Prev by Date: AppleScript support - 10.3/10.4
  • Next by Date: Re: Strange window controller behaviour with "move focus to next window..."
  • Previous by thread: AppleScript support - 10.3/10.4
  • Next by thread: Re: How to get the stroke geometry of a NSBezierPath?
  • Index(es):
    • Date
    • Thread