@xviewer.js/core 1.0.4-alpha.7 → 1.0.4-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -2787,14 +2787,16 @@ class DeviceInput extends Component {
2787
2787
  const isDocument = target instanceof Document;
2788
2788
  const width = isDocument ? window.innerWidth : target.offsetWidth;
2789
2789
  const height = isDocument ? window.innerHeight : target.offsetHeight;
2790
- this._pointer.x = e.clientX / width * 2 - 1;
2791
- this._pointer.y = 1 - e.clientY / height * 2;
2792
- this._pointerPixel.set(e.clientX, e.clientY);
2790
+ this._pointer.x = e.pageX / width * 2 - 1;
2791
+ this._pointer.y = 1 - e.pageY / height * 2;
2792
+ this._pointerPixel.set(e.pageX, e.pageY);
2793
2793
  }
2794
2794
  _onPointerDown(e) {
2795
2795
  e = this._remapPointer(e);
2796
2796
  this._pointerButton = e.button;
2797
2797
  this._computePointer(e);
2798
+ this._prePointer.copy(this._pointer);
2799
+ this._prePointerPixel.copy(this._pointerPixel);
2798
2800
  this._pressability.pointerDown(this._pointer, this.viewer.camera);
2799
2801
  this.viewer.emit(DeviceInput.POINTER_DOWN, e);
2800
2802
  }
@@ -2841,6 +2843,7 @@ class DeviceInput extends Component {
2841
2843
  preTouches[i].position.copy(touches[i].position);
2842
2844
  }
2843
2845
  }
2846
+ this._touchCount = curr.length;
2844
2847
  this.viewer.emit(DeviceInput.TOUCH_START, e);
2845
2848
  }
2846
2849
  _onTouchEnd(e) {