Re: Group CGAffineTransform Animations?
Re: Group CGAffineTransform Animations?
- Subject: Re: Group CGAffineTransform Animations?
- From: David Duncan <email@hidden>
- Date: Thu, 18 Jun 2009 09:39:00 -0700
On Jun 17, 2009, at 10:45 PM, WT wrote:
If the center is in the superview's coordinate system, how can it
not be changed by a translation?
Because the center is only 1 part in the chorus of things that
determines where your view is. All of this really translates to Core
Animation under the covers, and what UIKit reports to you as the
center of a view is the view's layer's position. So lets go strictly
to layers for a moment.
A layer has 4 properties that affect its area on screen – position,
bounds.size, anchorPoint and transform. All of these properties
together produce the final bounding rect in 3D space for the layer,
which is then flattened into the frame rect that we all know and love.
So the position property of the layer never changes when you transform
a layer, regardless of the transform. The layer moves when you apply a
translation transform to it because you've changed the bounding rect
that was calculated from the transform along with the other 3
properties I mentioned.
In the view's own coordinate system, yes, I can see that that's
true, because then the center is half-way the bounds' width and
height, and those don't change under a translation.
The view's center property is the point around which the view bounds
are located. If you change the view's layer's anchorPoint, then the
view's center will have a different meaning. It defaults to half way
between, but really its saying to place half of the bounds on either
side of the position.
--
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