@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 +6 -3
- package/dist/main.cjs.map +1 -1
- package/dist/module.js +6 -3
- package/dist/module.js.map +1 -1
- package/package.json +1 -1
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.
|
|
2791
|
-
this._pointer.y = 1 - e.
|
|
2792
|
-
this._pointerPixel.set(e.
|
|
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) {
|