Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- board.onmousedown = function(e) {
- var x = e.pageX - this.offsetLeft;
- var y = e.pageY - this.offsetTop;
- ctx.fillStyle = "#000000"
- ctx.beginPath();
- ctx.arc(x, y, 10, 0 , 2 * Math.PI, false);
- ctx.fill();
- ctx.closePath();
- ctx.fillText(++node_id, x+10, y-10);
- node_set.push({id: node_id, "x": x, "y": y});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement