Merge pull request #37 from jelenamilanovic/fix/drawing-app

Stop drawing when mouse is released outside of the canvas
pull/74/head
Brad Traversy 3 years ago committed by GitHub
commit af3b536669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,7 +21,7 @@ canvas.addEventListener('mousedown', (e) => {
y = e.offsetY y = e.offsetY
}) })
canvas.addEventListener('mouseup', (e) => { document.addEventListener('mouseup', (e) => {
isPressed = false isPressed = false
x = undefined x = undefined

Loading…
Cancel
Save