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

View file

@ -30,6 +30,10 @@ function Canvas(width, height, upscale) {
this.elem.addEventListener('mousedown', function (e) {
that.clicked = true;
});
this.elem.addEventListener('touchstart', function (e) {
that.clicked = true;
});
this.elem.addEventListener('touchmove', function (e) {
that.pageX = e.touches[0].pageX;
@ -60,6 +64,13 @@ function Canvas(width, height, upscale) {
that.firstY = this.pageY;
});
this.elem.addEventListener('touchend', function (e) {
that.clicked = false;
that.firstX = this.pageX;
that.firstY = this.pageY;
});
this.clicked = false;
this.pageX = 0;