html5 - Fill color for an arc drawed by canvas -
i trying fill color arc. but, don't want use ctx.linewidth
that.
i try draw here. please teach me how fill color it.
you need define continuous path able fill single color if don't want use line-width.
using 2 arcs means need "reverse" 1 of them end-points connect correctly without crossing. can using counter-close wise flag @ end set true , swap start , end angles:
ctx.arc(w/2, h, h-40, 2*math.pi, math.pi, true); // ccw, swapped angles ctx.arc(w/2, h, h, math.pi, 2*math.pi); ctx.fill(); // can filled
Comments
Post a Comment