Transform won’t change view.center

June 19, 2009 § Leave a comment

A lot of confusion related to finding the coordinates and center of transformation on layer. This provide a little bit of understanding.

A layer has 4 properties that affect its area on screen

  • position
  • bounds.size
  • anchorPoint
  • transform

These properties produce the final bounding rect in 3D space for the layer. Then it is flattened into the frame rect.

View’s center property is the point where the view bounds are located. The view’s center will change only if you change the view’s layer’s anchorPoint.

Position property of the layer never changes when you transform a layer regardless of the transform. However, the layer moves only when you apply a translation transform. It is caused by the changes of the bounding rect that is calculated from the transform with other 3 properties.

Where Am I?

You are currently browsing the Animation category at Web Builders.