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

Stop drawing when mouse is released outside of the canvas
This commit is contained in:
Brad Traversy 2021-07-31 10:32:00 -04:00 committed by GitHub
commit af3b536669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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