title: Drawing lines along the cursor path in KineticJS
body: <p>I am using KineticJS to implement a drawing application. I have used it to draw shapes, straight lines. I have used way described in <a href="https://stackoverflow.com/questions/12311535/kineticjs-drawing-lines-with-mouse">KineticJS - Drawing Lines with Mouse</a> to draw straight lines. But now my requirement is to draw line along the mouse path! What should be the procedure for that? Can we use Kinetic.Path to do that?</p>
  
  <p>Following code is used to draw straight lines,</p>
  
  <pre><code>    var Object,startingPoint;
      var down = false;
  
      layer.on("mousedown", function(e) {
          down = true;
          Object = new Kinetic.Line({
              points: [e.layerX, e.layerY,e.layerX+1, e.layerY+1],
              stroke: "red"
          });
  
          layer.add(Object);
      });
  
      layer.on("mousemove", function(e) {
           if (down) {
                  var x = e.layerX;
                  var y = e.layerY;
                  Object.getPoints()[1].x = e.layerX;
                  Object.getPoints()[1].y = e.layerY;
                  down = true;
                  layer.draw();
           }        
      });
  
      layer.on("mouseup", function(e) {
          down = false;
      });
  </code></pre>
  
  <p>I have replaced  Kinetic.Line with Kinetic.Path to achieve the target. But it didn't work. </p>