Created
April 1, 2018 22:58
-
-
Save sirdarthvader/638a98b899fe1e368b0bfbacd13c705a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let isDrawing = false; | |
let lastX = 0; | |
let lastY = 0; | |
function draw (e) { | |
if(!isDrawing) return ; | |
console.log(e); | |
ctx.beginPath(); | |
ctx.moveTo(lastX, lastY); | |
ctx.lineTo(e.offsetX, e.offsetY); | |
ctx.stroke(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment