From 93ba24a53a14f36229d1dc2b3c68e456e97f5d2e Mon Sep 17 00:00:00 2001 From: Nathan DECHER Date: Thu, 26 Mar 2020 12:17:54 +0100 Subject: [PATCH] touchscreen is now in 45% quadrants and not the window diagonals --- src/js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/main.js b/src/js/main.js index 14339f3..aa35216 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -109,8 +109,8 @@ const handleTouch=e => { e.preventDefault(); - let x=e.touches[0].clientX/window.innerWidth-.5; - let y=e.touches[0].clientY/window.innerHeight-.5; + let x=e.touches[0].clientX-window.innerWidth/2; + let y=e.touches[0].clientY-window.innerHeight/2; const angle=((Math.atan2(x, y)+2*Math.PI)%(2*Math.PI))/Math.PI; let inputs=currentInputs;