Drawing dashed and continuous lines

Safari picture Safari · Jun 9, 2011 · Viewed 8.8k times · Source

I need to draw lines; some are dashed and others are continuous. I cannot know which are dashed and which are not. When I draw the dashed lines, I use this:

CGContextSetLineDash(context, 5, linedashPattern, 2); // set dashed line

It happens, however, that if I draw a dotted line the next ones are also all dashed. Is there an operation to reset the "Dashed" state, to draw a continuous line? For example:

CGContextSetLineContinuous(context,......); // set continuous line

Answer

Nikolai Ruhe picture Nikolai Ruhe · Jun 9, 2011
CGContextSetLineDash(context, 0, NULL, 0);

B.t.w. I can only recommend to check the documentation. Definitely faster than posting a question on SO ;)