• 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: Which CA Layer am I dragging over?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which CA Layer am I dragging over?


  • Subject: Re: Which CA Layer am I dragging over?
  • From: David Duncan <email@hidden>
  • Date: Thu, 28 Jan 2010 09:38:17 -0800

On Jan 28, 2010, at 9:26 AM, K. Darcy Otto wrote:

> The problem is that I'm having difficulty setting up the NSTrackingAreas.  Given CA layer x, I want to discover the position of x in the window so I can set up the tracking area.   Is this the right way to solve this problem?  If so, how do I get the rect for layer x?

NSRectFromCGRect() is basically just a typecast, but you need a coordinate conversion. The way to do this is to first convert the bounds of layer X to a rectangle in the coordinate system of your view's layer, which can be done with -convertRect:fromLayer: (note, you want bounds NOT frame here – if you use frame you need to convert from layer x's superlayer because the frame is in the layer' superlayer's coordinate system).

Overall you may find it easier to simply setup a tracking area for the entire view and then hit test to find the layer of interest instead, especially since moving the layers around would mean moving the tracking areas around too.
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

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: Which CA Layer am I dragging over?
      • From: "K. Darcy Otto" <email@hidden>
References: 
 >Size of Core Animation Layer (From: K.Darcy Otto <email@hidden>)
 >Re: Size of Core Animation Layer (From: vincent habchi <email@hidden>)
 >Which CA Layer am I dragging over? (From: "K. Darcy Otto" <email@hidden>)

  • Prev by Date: Re: Displaying animated content in iPhone app
  • Next by Date: Re: NSSlider
  • Previous by thread: Which CA Layer am I dragging over?
  • Next by thread: Re: Which CA Layer am I dragging over?
  • Index(es):
    • Date
    • Thread