I have many points constructing a line. How can I draw a wavy line through those points?
Example:
- (void)drawRect:(NSRect)rect
{
NSBezierPath *curve = [NSBezierPath bezierPath];
[curve moveToPoint:NSMakePoint(0,50)];
[curve relativeCurveToPoint:NSMakePoint(150,50) controlPoint1:NSMakePoint(50,100) controlPoint2:NSMakePoint(100,0)];
[[NSColor redColor] set];
[curve stroke];
}
Result:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With