forked from extern/easydiffusion
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:
parent
367e7f7065
commit
8eeca90d55
@ -372,7 +372,7 @@ class ImageEditor {
|
|||||||
var y = (touch.clientY || 0) - bbox.top
|
var y = (touch.clientY || 0) - bbox.top
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
event.preventDefault()
|
||||||
// do drawing-related stuff
|
// do drawing-related stuff
|
||||||
if (type == "mousedown" || (type == "mouseenter" && event.buttons == 1)) {
|
if (type == "mousedown" || (type == "mouseenter" && event.buttons == 1)) {
|
||||||
if (this.dropper_active) {
|
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("init_image_button_inpaint").addEventListener("click", () => {
|
||||||
document.getElementById("image-inpainter").classList.toggle("active")
|
document.getElementById("image-inpainter").classList.toggle("active")
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user