touchscreen is now in 45% quadrants and not the window diagonals

main
Codinget 5 years ago
parent f2859e9652
commit a543b11b4d
  1. 4
      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;

Loading…
Cancel
Save