Page 1 of 1

Canvas arc CCW setting

Posted: 16 Mar 2014 22:32
by Softcore
Im not experienced with html5 canvas but I have reasons to believe the CCW setting in

canvas_arc(c, x, y, r, start, end,ccw)

doesnt work!

If it did, shouldnt I be able to get the "larger" part of the "circle" instead of the small one in my attached example? it seems as though the parser always chooses the "shorter" route for the path...is that even possible? I tried switching the CCW setting, I even tried switching the end-start points....but still.....

:(

Re: Canvas arc CCW setting

Posted: 16 Mar 2014 23:24
by Softcore

Re: Canvas arc CCW setting

Posted: 17 Mar 2014 00:52
by Macciza
Hi
Yes it does seem like there is some 'oddness' going on . . .

One solution is simply changing values - .75*pi,2.25*pi instead of 0.25*pi,0.75*pi . . .

MM

Re: Canvas arc CCW setting

Posted: 17 Mar 2014 10:44
by Softcore
Ok! I didnt know I could use negative values....

This did what I was after!

-1.25*pi, .25*pi

Re: Canvas arc CCW setting

Posted: 17 Mar 2014 11:15
by Macciza
I can't see why not - it is simply describing a point on the arc ....
-1.25*pi is the same point as .75 . . .
And .25 is the same point as 2.25 . .
Though mixing the values can lead to the wrong arc . .
Pretty sure it will get sorted soon enough . ..

Am similarly going through various Canvas tuts of Net and converting them, as well as picking apart the provided examples . .
Yes it will take a little time to get up to speed on it all, but it is often productive play that can breed new ideas . ..
Lots of different ways to achieve similar things, as well as different ways to structure complex draw functions . ..

MM

Re: Canvas arc CCW setting

Posted: 17 Mar 2014 17:42
by nick_liine
Thanks for the report, investigating.