فهرست منبع

Merge pull request #1267 from haxiomic/patch-2

Panning control fix
David Catuhe 9 سال پیش
والد
کامیت
bc5b5515b5
1فایلهای تغییر یافته به همراه1 افزوده شده و 11 حذف شده
  1. 1 11
      src/Cameras/Inputs/babylon.arcrotatecamera.input.pointers.ts

+ 1 - 11
src/Cameras/Inputs/babylon.arcrotatecamera.input.pointers.ts

@@ -17,7 +17,6 @@ module BABYLON {
         public panningSensibility: number = 50.0;
 
         private _isPanClick: boolean = false;
-        private _isCtrlPushed: boolean = false;
         public pinchInwards = true;
 
         private _pointerInput: (p: PointerInfo, s: EventState) => void;
@@ -89,7 +88,7 @@ module BABYLON {
                     // One button down
                     if (pointA && pointB === undefined) {
                         if (this.panningSensibility !== 0 &&
-                            ((this._isCtrlPushed && this.camera._useCtrlForPanning) ||
+                            ((evt.ctrlKey && this.camera._useCtrlForPanning) ||
                                 (!this.camera._useCtrlForPanning && this._isPanClick))) {
                             this.camera
                                 .inertialPanningX += -(evt.clientX - cacheSoloPointer.x) / this.panningSensibility;
@@ -150,14 +149,6 @@ module BABYLON {
                 cacheSoloPointer = null;
             };
 
-            this._onKeyDown = evt => {
-                this._isCtrlPushed = evt.ctrlKey;
-            };
-
-            this._onKeyUp = evt => {
-                this._isCtrlPushed = evt.ctrlKey;
-            };
-
             this._onMouseMove = evt => {
                 if (!engine.isPointerLock) {
                     return;
@@ -225,7 +216,6 @@ module BABYLON {
                 element.removeEventListener("keyup", this._onKeyUp);
 
                 this._isPanClick = false;
-                this._isCtrlPushed = false;
                 this.pinchInwards = true;
 
                 this._onKeyDown = null;