From 1d14225d3b74bb4d66ef469a860dd359051fa98c Mon Sep 17 00:00:00 2001 From: Gian Marco Todesco Date: Tue, 21 Jan 2020 12:11:42 +0100 Subject: [PATCH] . --- main.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 0e9e645..e73f8e4 100644 --- a/main.js +++ b/main.js @@ -319,6 +319,9 @@ class PointerHandler { var x = e.clientX + offx - me.canvas.width/2 var y = e.clientY + offy - me.canvas.height/2 me.notifyStroke(x, y) + if(location.search == "?test") + document.getElementById('console').innerHTML = "drag:" + x+","+y + } function onRelease (e) { e.preventDefault() @@ -347,10 +350,10 @@ class PointerHandler { e.preventDefault() let touches = e.changedTouches if(touches.length>0) { - if(location.search == "?test") - document.getElementById('console').innerHTML = touches[0].offsetX var x = touches[0].clientX - me.canvas.width/2 var y = touches[0].clientY - me.canvas.height/2 + if(location.search == "?test") + document.getElementById('console').innerHTML = "touch:" + x+","+y me.notifyStroke(x,y) } } @@ -399,8 +402,9 @@ class Application { endStroke() { const length = this.targetCrv.pixelLength - // if(location.search == "?test") - // document.getElementById('console').innerHTML = this.targetCrv.points.length + if(location.search == "?test") + document.getElementById('console').innerHTML = + this.targetCrv.points.length + ", " + length if (length > 10) {