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.
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
Post a Comment