• 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
Hit testing open bezier path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hit testing open bezier path


  • Subject: Hit testing open bezier path
  • From: John Nestor <email@hidden>
  • Date: Wed, 07 Aug 2002 13:42:55 -0400

I am trying to use the - (BOOL)containsPoint:(NSPoint)aPoint method to hit test an NSBezierPath. I am working
with a sine curve as an example during development. The bezier path is stroked but not filled (stirred, not shaken?).

The hit testing returns as though the path were filled (thus closing the path) as well as stroked. It returns
a positive hit anywhere between the x-axis and the curve as well as on the curve. I've tried the various winding rules.
All give the same result.

I can avoid this problem by enumerating over the list of segments in the curve. I hit test each of the segments and report successes.
Seems like a lot of work.

Is there a way to make - (BOOL)containsPoint:(NSPoint)aPoint consider only the open curve or does it insist
on closing the curve before doing the hit test? Orrrr... am I missing something basic?

Tnx, JN
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: NSMenuItem setImage:
  • Next by Date: Re: Accessors
  • Previous by thread: Re: NSMenuItem setImage:
  • Next by thread: How to make window not taking focus?
  • Index(es):
    • Date
    • Thread