I’m learning how to build an web app using GWT. I want to draw an arc but no matter the start and stop angle, I always get a full circle. I’ve tried
context2d.arc((double)cx, (double)cy, 40., 0., 180., true);
context2d.stroke();
and
context2d.beginPath();
context2d.arc((double)cx, (double)cy, 40., 0., 180., true);
context2d.closePath();
context2d.stroke();
and each time I get a full circle. I’ve even added context2d.save() before and context2d.restore() after and still a full circle.
From documentation
0 and 180 are in degrees.
Try instead of 180 to use 3.14159265 (which is actually 180 degress in radians)