1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-09-28 00:59:00 +02:00

fricking debugging man

This commit is contained in:
Pomax
2020-08-08 13:08:30 -07:00
parent 3bb6785bd6
commit deda62b17b
2 changed files with 19 additions and 5 deletions

View File

@@ -92,17 +92,23 @@ class BaseAPI {
getCursorCoords(evt) {
const left = evt.target.offsetLeft,
top = evt.target.offsetTop;
let x, y;
if (evt.targetTouches) {
const touch = evt.targetTouches;
for (let i=0; i<touch.length; i++) {
console.log(touch[i]);
if (!touch[i] || !touch[i].pageX) continue;
this.cursor.x = touch[i].pageX - left;
this.cursor.y = touch[i].pageY - top;
x = touch[i].pageX - left;
y = touch[i].pageY - top;
}
} else {
this.cursor.x = evt.pageX - left;
this.cursor.y = evt.pageY - top;
x = evt.pageX - left;
y = evt.pageY - top;
}
this.cursor.x = x;
this.cursor.y = y;
}
/**