• 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: Rotation in CAAnimation layers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rotation in CAAnimation layers


  • Subject: Re: Rotation in CAAnimation layers
  • From: Ricky Sharp <email@hidden>
  • Date: Sat, 25 Oct 2008 08:56:12 -0500


On Oct 25, 2008, at 8:31 AM, DKJ wrote:

I do this with a CAAnimation layer myLayer:

	myLayer.shadowOffset = CGSizeMake( 5.0, 5.0 );

and get a shadow on the upper and right edges. But when I rotate the layer 180 degrees, the shadow then appears on the lower and left edges. Real shadows don't do that.

If the object were circular, I'd just put another stationary layer underneath and attach the shadow to it. But with other shapes this won't work.

So finally, my question: Is there an easy way of calculating the position and appearance of the shadow for non-circular shapes? (By "easy" I mean one that I can just copy from somewhere.) If not I'll try to figure it out myself; but I don't want to re-invent the wheel.


It sounds like you want a fixed shadow position regardless of rotation. Note that whenever you apply a rotation (or transformation for that matter), shadow offsets are also adjusted accordingly.

Whenever you rotate your layers, you'll need to re-calculate your shadow offsets accordingly.

Also, there may exist an API to allow for shadows to be fixed? Not sure about that. Wouldn't be a bad enhancement to file though.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com



_______________________________________________

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


References: 
 >Rotation in CAAnimation layers (From: DKJ <email@hidden>)
 >Re: Rotation in CAAnimation layers (From: douglas welton <email@hidden>)
 >Re: Rotation in CAAnimation layers (From: DKJ <email@hidden>)

  • Prev by Date: Re: Rotation in CAAnimation layers
  • Next by Date: Controlling Preference Panel Installation
  • Previous by thread: Re: Rotation in CAAnimation layers
  • Next by thread: Re: Rotation in CAAnimation layers
  • Index(es):
    • Date
    • Thread