ios - CGPathAddArc clockwise and anticlockwise confusion -


below code draws arc m_pi/2 m_pi.

cgcontextref contet=uigraphicsgetcurrentcontext();  cgmutablepathref path = cgpathcreatemutable(); cgpathaddarc(path, null, cgrectgetmidx(rect), cgrectgetmidy(rect), cgrectgetmidx(rect),  m_pi/2.0,m_pi, yes);  cgcontextaddpath(contet, path); cgcontextsetstrokecolorwithcolor(contet, [uicolor redcolor].cgcolor); cgcontextstrokepath(content); 

below drawing of above code.

enter image description here

i expecting draw in empty or missing part , clockwise. referred answer why giving addarcwithcenter startangle of 0 degrees make start @ 90 degrees? but, don't know wrong.

you should pay more attention method used.

cgpathaddarc(path, null, cgrectgetmidx(rect), cgrectgetmidy(rect), cgrectgetmidx(rect),  m_pi/2.0,m_pi, no); 

just change last parameter no, want, can control drawing direction.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -