This commit is contained in:
Pavel Dobryakov
2017-08-27 19:53:58 +03:00
parent 5a83634224
commit 4a5cad017a
2 changed files with 3 additions and 9 deletions

View File

@@ -584,7 +584,7 @@ canvas.addEventListener('touchmove', (e) => {
pointer.x = touches[i].pageX;
pointer.y = touches[i].pageY;
}
}, false);
}, { passive: true });
canvas.addEventListener('mousedown', () => {
pointers[0].down = true;
@@ -603,7 +603,7 @@ canvas.addEventListener('touchstart', (e) => {
pointers[i].y = touches[i].pageY;
pointers[i].color = [Math.random() + 0.2, Math.random() + 0.2, Math.random() + 0.2];
}
});
}, { passive: true });
window.addEventListener('mouseup', () => {
pointers[0].down = false;
@@ -615,8 +615,4 @@ window.addEventListener('touchend', (e) => {
for (let j = 0; j < pointers.length; j++)
if (touches[i].identifier == pointers[j].id)
pointers[j].down = false;
});
window.addEventListener("load", () => {
window.scrollTo(1, 0);
}, false);
});