Prevent clicks from touches on touchpad

This commit is contained in:
Unrud 2022-02-21 22:30:20 +01:00
parent db9ca255fa
commit 1797d7585b

View file

@ -217,6 +217,7 @@ function handleTouchend(evt) {
if (idx < 0) {
continue;
}
evt.preventDefault();
ongoingTouches.splice(idx, 1);
touchReleasedCount += 1;
touchLastEnd = evt.timeStamp;
@ -259,6 +260,7 @@ function handleTouchmove(evt) {
if (idx < 0) {
continue;
}
evt.preventDefault();
if (!touchMoved) {
var dist = Math.sqrt(Math.pow(touches[i].pageX - ongoingTouches[idx].pageXStart, 2) +
Math.pow(touches[i].pageY - ongoingTouches[idx].pageYStart, 2));