kineticjs - draw multiple lines and delete individual line -
i can draw multiple lines on canvas; added layer using drawscene
dlayera1.add(line); line.getpoints()[0].x = mousepos.x; line.getpoints()[0].y = mousepos.y; line.getpoints()[1].x = mousepos.x; line.getpoints()[1].y = mousepos.y; moving = true; dlayera1.drawscene();
http://jsfiddle.net/user373721/xzead/1/.
is there way delete individual line?
currently, you'll have modify points array this:
line.getpoints()[0].splice(index, 1);
since arrays modified reference, modifying returned array modifies "source of truth" points array attr
Comments
Post a Comment