Hi, I'm drawing a line in a CATiledLayer using the following code:
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx {
CGContextMoveToPoint(ctx, 130, 100.5);
CGContextAddLineToPoint(ctx, 160, 100.5);
CGContextSetRGBStrokeColor(ctx, 1, 0, 0, 1);
CGContextSetRGBFillColor(ctx, 1, 0, 0, 1);
CGContextDrawPath(ctx, kCGPathStroke);
}
What I get is this 4px blurry line:
http://img837.imageshack.us/img837/5002/fuzzyline.png
If I change the CATiledLayer to a CALayer, the line is sharp and its width is 2px, as expected. I get this behavior only on iPhone 4, on 3GS the line is sharp on both CALayer and CATiledLayer. Of course, on 3GS the line is 1px thick.
Any idea how to overcome this behavior.