views:

127

answers:

1

Currently I draw a zig-zap line by CGContextMoveToPoint, CGContextAddLineToPoint, and CGContextStrokePath, following touchesMoved events. How can I smooth the edges of the line? Such that when the user draw a circle-like shape, the circle can be more round'ed. The GLPaint example use OpenGL, is that the only way to do it?

+2  A: 

You can simply set the line join to round, to make the edges less visible:

CGContextSetLineJoin(ctx, kCGLineJoinRound);

Other than that you option would be to use some kind of spline interpolation.

Nikolai Ruhe