Search code examples
objective-cioscalayercgaffinetransform

CGAffineTransformMakeRotation of a CALayer


I create a layer and I set a frame for it. Then I apply a CGAffineTransformMakeRotation to it. The result of this is a squeezed object because the frame remains the same. How do I rotate the layer and also reset the frame so it would not look squeezed.


Solution

  • I solved it: instead of setting the frame, I set the center (position) and bounds. This way, miraculously the problem disappears.