Thursday, March 25, 2010

Quartz2D scaled stroked rects bug

This demonstrates a problem with some relatively simple drawing, it draws a stroked rectangle with some scaling and translation applied. The result is some very thin lines.

The curious thing is that under certain conditions the rectangle is drawn with overly thick lines. The conditions in this example are:

a) The width of the view is a multiple of 200 (400, 600, etc).
b) The rectangle is scaled vertically such that it is larger than the clip area

You can play with the slider to scale it vertically, and resize the window to get the view size a multiple of 200. This could probably be boiled down to an even simpler case but I won't bother.

Using 10.6.2

Xcode project:2010-03-24-bug.zip

0 Comments:

Post a Comment

<< Home