Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drawing dashed and continuous lines

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
like image 923
Safari Avatar asked Jun 09 '11 17:06

Safari


1 Answers

CGContextSetLineDash(context, 0, NULL, 0);

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

like image 67
Nikolai Ruhe Avatar answered Sep 28 '22 02:09

Nikolai Ruhe