Browse Source

Fix pointer issue with preProcess

David Catuhe 6 years ago
parent
commit
51970f6872
1 changed files with 4 additions and 3 deletions
  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 => {