Fix weird scrolling when using a pen (#588)

With a pen, typing on a browser page, waiting a short moment, and then moving the pen scrolls the page.
Call event.preventDefault() to disable this default behaviour for events in the canvas area.
This commit is contained in:
JeLuF 2022-12-02 10:10:21 +01:00 committed by GitHub
parent 367e7f7065
commit 8eeca90d55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -372,7 +372,7 @@ class ImageEditor {
var y = (touch.clientY || 0) - bbox.top
}
}
event.preventDefault()
// do drawing-related stuff
if (type == "mousedown" || (type == "mouseenter" && event.buttons == 1)) {
if (this.dropper_active) {
@ -489,4 +489,4 @@ document.getElementById("init_image_button_draw").addEventListener("click", () =
})
document.getElementById("init_image_button_inpaint").addEventListener("click", () => {
document.getElementById("image-inpainter").classList.toggle("active")
})
})