How do I remove those rotation artefacts from my CATiledLayer?

Posted by Felix on Stack Overflow See other posts from Stack Overflow or by Felix
Published on 2010-04-07T06:39:06Z Indexed on 2010/04/07 6:43 UTC
Read the original article Hit count: 373

Hello all,

I have a CATiledLayer into which I render content in the following method

- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx

I used the QuartzDemo code to draw a pattern. This works very well until I apply a rotation transform to the layer's parentLayer (a UIView):

Non-Rotated CATiledLayer

rotated:

Rotated CATiledLayer

These zigzag artefacts become worse when I start drawing lines and texts into the CATiledLayer.

I applied the transform as follows (I also tried using an affine transform on the view itself):

self.containerView.layer.transform = CATransform3DMakeRotation(angleRadians, 0.0f, 0.0f, 1.0f);

I transform the containerView rather than the layer itself, as I have several layers in that view that I would like to rotate at the same time without changing the relative positions.

I did not have problems when rotating UIImageViews in the past.

Is there a way that I can rotate the CATiledLayer without these problems?

Any help would be greatly appreciated.

Yours,

Felix

© Stack Overflow or respective owner

Related posts about catiledlayer

Related posts about iphone