How to smooth the edge of a zig-zag line?
Currently I draw a zig-zap line by CGContextMoveToPoint
, CGContextAddLineToPoint
, and CGContextStrokePath
, following touchesMoved
events. How can I smoo开发者_开发问答th 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?
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.
精彩评论