Reputation: 3844
I can draw line with the following code successfully:
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.moveTo(0,0);
ctx.lineTo(200,100);
ctx.stroke();
Is it possible to change the start point or end point location(i.e. coordinate) of the line? Do I need to clear the whole context? I want to the mouse to drag either end for drawing a circle or sector.
Upvotes: 0
Views: 2239