1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-08-31 20:11:59 +02:00
This commit is contained in:
Pomax
2020-08-08 12:03:41 -07:00
parent 1b40e3fcd9
commit 89c7fe9d93

View File

@@ -90,10 +90,10 @@ class BaseAPI {
*
*/
getCursorCoords(evt) {
if (e.targetTouches) {
const rect = e.target.getBoundingClientRect();
this.cursor.x = e.targetTouches[0].pageX - rect.left;
this.cursor.y = e.targetTouches[0].pageY - rect.top;
if (evt.targetTouches) {
const rect = evt.target.getBoundingClientRect();
this.cursor.x = evt.targetTouches[0].pageX - rect.left;
this.cursor.y = evt.targetTouches[0].pageY - rect.top;
} else {
this.cursor.x = evt.offsetX;
this.cursor.y = evt.offsetY;