• 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: A pie analyzer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A pie analyzer


  • Subject: Re: A pie analyzer
  • From: Calum Robinson <email@hidden>
  • Date: Sat, 19 Apr 2003 21:05:02 +0100

On Saturday, April 19, 2003, at 05:18 pm, Tony S. Wu wrote:

My problem is, NSView only allows me to add tooltip for a rect.
I thought about using NSBezierPath's containsPoint method.
But I am not sure if it's a good idea since i'll be calling this method for average 5 to 8 times each time a user moves his mouse.

Couldn't you convert the point in your custom view to polar coordinates? Offset the mouse location to the centre of the pie and then find the angle & distance from the origin. If the distance is greater than the radius, the mouse is outside the pie. Then, use the angle with the values in the pie chart to figure out which 'slice' it's in.


Calum
_______________________________________________
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.

References: 
 >A pie analyzer (From: "Tony S. Wu" <email@hidden>)

  • Prev by Date: Re: protecting time-limited demos
  • Next by Date: Re: A pie analyzer
  • Previous by thread: Re: A pie analyzer
  • Next by thread: Re: A pie analyzer
  • Index(es):
    • Date
    • Thread