add touchmove

This commit is contained in:
biglyderv 2025-05-16 14:15:58 -04:00
parent da4f5afbe9
commit 8275c8decc
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5

View file

@ -31,6 +31,11 @@ function Canvas(width, height, upscale) {
that.clicked = true; that.clicked = true;
}); });
this.elem.addEventListener('touchmove', function (e) {
that.pageX = e.touches[0].pageX;
that.pageY = e.touches[0].pageY;
})
this.elem.addEventListener('mousemove', function (e) { this.elem.addEventListener('mousemove', function (e) {
that.pageX = e.pageX; that.pageX = e.pageX;
that.pageY = e.pageY; that.pageY = e.pageY;