From 0fb19d45ad87998ecbfcdef6ddb7bd301636420c Mon Sep 17 00:00:00 2001 From: biglyderv Date: Fri, 16 May 2025 14:17:01 -0400 Subject: [PATCH] stuff --- js/core.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/core.js b/js/core.js index aa3578c..3846d5f 100644 --- a/js/core.js +++ b/js/core.js @@ -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;