Whenever I stroke a path with rounded corner开发者_运维技巧s on iPhone, the rounded corners are thicker than the rest of the stroked path. See here for what I mean:
rounded corner thickness http://img181.imageshack.us/img181/6372/screenshot20100320at123.png
Not sure why this happens, any ideas?
I agree with Peter Hosey's analysis that the outer half of your lines is getting clipped off, but my recommendation would be to move all the coordinates .5 pixels inward instead. This way your straight lines will be crisper (not antialiased across 2 screen pixels) as well.
I suspect that you're drawing within a rectangular clipping path; the corners fall completely within the rectangle, but the sides get cut in half: half inside the clipping path and so drawn, half outside and so clipped out.
Try adding the path to the clipping path before stroking it.
To do this, you will need to add the CGPath to the context's current path twice:
- Add CGPath to current path.
- Add current path to clipping path (thereby emptying current path).
- Add CGPath to current path.
- Stroke current path.
It just looks thicker. If you zoom in on it you will see what looks like a couple extra pixels of black is actually some pixels of gray caused by antialiasing.
Try turning off antialiasing to see if the result looks better.
Edit: Also the bottom right corner seems to have a drop shadow effect.
精彩评论