use transform safe offsetX instead of clientX

This commit is contained in:
Benjamin Babik 2017-03-19 22:19:36 +00:00 committed by GitHub
parent b0c6dc5fb1
commit 22efc603d8

View File

@ -705,13 +705,13 @@
if (evt.touches.length > 0) {
var touch = evt.touches[0];
// get the information for finger #1
x = touch.clientX - contentPosition.left;
y = touch.clientY - contentPosition.top;
x = touch.offsetX;
y = touch.offsetY;
}
} else {
// mouse events
x = evt.clientX - contentPosition.left;
y = evt.clientY - contentPosition.top;
x = evt.offsetX;
y = evt.offsetY;
}
if (x !== null && y !== null) {
this.pointerPos = {