I have the following code to draw a zig-zag line. Works great, but I want to make each line segment a different width than all the others. I want each segment to be a little thinner than the last one. I can't figure out how to change one of them without changing all of them.
thx
Code:
for (int arrayPointer = 0; arrayPointer != (arrayWithPoints.count); arrayPointer++)
{
NSValue *theValue = [arrayWithPoints objectAtIndex: arrayPointer];
CGPoint thePoint = [theValue CGPointValue];
if (arrayPointer == 0)
{
CGContextBeginPath(context);
CGContextMoveToPoint(context, thePoint.x, thePoint.y);
}
else
{
CGContextAddLineToPoint(context, thePoint.x, thePoint.y);
}
}
CGContextSetLineWidth(context, 20);
thx