I want to Draw a line and make it drag-able from both the Ends. Using the mouse click i am able to draw the line but i want to drag the line and resize it later.
var canvas = document.getElementById("myCanvas");
var ctx = canvas.getContext("2d");
ctx.moveTo(10,20);
ctx.lineTo(100, 120);
ctx.stroke();
Suppose if i am dragging point b to (200,150)
then the coordinates should be point
A(10,20) and point B(200,150).