Merge pull request #37 from jelenamilanovic/fix/drawing-app
Stop drawing when mouse is released outside of the canvas
This commit is contained in:
commit
af3b536669
@ -21,7 +21,7 @@ canvas.addEventListener('mousedown', (e) => {
|
||||
y = e.offsetY
|
||||
})
|
||||
|
||||
canvas.addEventListener('mouseup', (e) => {
|
||||
document.addEventListener('mouseup', (e) => {
|
||||
isPressed = false
|
||||
|
||||
x = undefined
|
||||
|
Loading…
Reference in New Issue
Block a user