@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/main.cjs CHANGED
@@ -2807,14 +2807,16 @@ class DeviceInput extends Component {
2807
2807
  const isDocument = target instanceof Document;
2808
2808
  const width = isDocument ? window.innerWidth : target.offsetWidth;
2809
2809
  const height = isDocument ? window.innerHeight : target.offsetHeight;
2810
- this._pointer.x = e.clientX / width * 2 - 1;
2811
- this._pointer.y = 1 - e.clientY / height * 2;
2812
- this._pointerPixel.set(e.clientX, e.clientY);
2810
+ this._pointer.x = e.pageX / width * 2 - 1;
2811
+ this._pointer.y = 1 - e.pageY / height * 2;
2812
+ this._pointerPixel.set(e.pageX, e.pageY);
2813
2813
  }
2814
2814
  _onPointerDown(e) {
2815
2815
  e = this._remapPointer(e);
2816
2816
  this._pointerButton = e.button;
2817
2817
  this._computePointer(e);
2818
+ this._prePointer.copy(this._pointer);
2819
+ this._prePointerPixel.copy(this._pointerPixel);
2818
2820
  this._pressability.pointerDown(this._pointer, this.viewer.camera);
2819
2821
  this.viewer.emit(DeviceInput.POINTER_DOWN, e);
2820
2822
  }
@@ -2861,6 +2863,7 @@ class DeviceInput extends Component {
2861
2863
  preTouches[i].position.copy(touches[i].position);
2862
2864
  }
2863
2865
  }
2866
+ this._touchCount = curr.length;
2864
2867
  this.viewer.emit(DeviceInput.TOUCH_START, e);
2865
2868
  }
2866
2869
  _onTouchEnd(e) {