Selaa lähdekoodia

Merge pull request #561 from vousk/fix-cameraPointerEvent

little patch to fix a bug on iPhone with pointer events
David Catuhe 10 vuotta sitten
vanhempi
commit
4ada0edbc1
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      Babylon/Cameras/babylon.arcRotateCamera.ts

+ 7 - 1
Babylon/Cameras/babylon.arcRotateCamera.ts

@@ -127,7 +127,13 @@
                 this._onPointerUp = evt => {
                     cacheSoloPointer = null;
                     previousPinchDistance = 0;
-                    pointers.remove(evt.pointerId);
+                    
+                    //would be better to use pointers.remove(evt.pointerId) for multitouch gestures, 
+                    //but emptying completly pointers collection is required to fix a bug on iPhone : 
+                    //when changing orientation while pinching camera, one pointer stay pressed forever if we don't release all pointers  
+                    //will be ok to put back pointers.remove(evt.pointerId); when iPhone bug corrected
+                    pointers.empty();
+                                       
                     if (!noPreventDefault) {
                         evt.preventDefault();
                     }