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

javascript - How do you prevent nested queries/catches in sequelize? -

java - Could not retrieve pre-bound Hibernate session - Could not obtain transaction-synchronized Session for current thread -

ruby on rails - ActiveRecord order not working -