Created
August 11, 2019 11:48
-
-
Save nidhinp/ab753c496d8999a955ff7c9bb0919d9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment