瀏覽代碼

Fix pointer issue with preProcess

David Catuhe 6 年之前
父節點
當前提交
51970f6872
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/babylon.scene.ts

+ 4 - 3
src/babylon.scene.ts

@@ -2020,6 +2020,10 @@ module BABYLON {
                     canvas.focus();
                 }
 
+                this._startingPointerPosition.x = this._pointerX;
+                this._startingPointerPosition.y = this._pointerY;
+                this._startingPointerTime = Date.now();
+
                 // PreObservable support
                 if (this._checkPrePointerObservable(null, evt, PointerEventTypes.POINTERDOWN)) {
                     return;
@@ -2030,9 +2034,6 @@ module BABYLON {
                 }
 
                 this._pointerCaptures[evt.pointerId] = true;
-                this._startingPointerPosition.x = this._pointerX;
-                this._startingPointerPosition.y = this._pointerY;
-                this._startingPointerTime = Date.now();
 
                 if (!this.pointerDownPredicate) {
                     this.pointerDownPredicate = (mesh: AbstractMesh): boolean => {