Prechádzať zdrojové kódy

Merge pull request #7594 from CedricGuillemet/cameraPreventDefaultAttach

prevent default for camera attach when drag is finished
David Catuhe 5 rokov pred
rodič
commit
f6ac666504

+ 1 - 1
src/Behaviors/Meshes/pointerDragBehavior.ts

@@ -252,7 +252,7 @@ export class PointerDragBehavior implements Behavior<AbstractMesh> {
 
         // Reattach camera controls
         if (this.detachCameraControls && this._attachedElement && this._scene.activeCamera && !this._scene.activeCamera.leftCamera) {
-            this._scene.activeCamera.attachControl(this._attachedElement, true);
+            this._scene.activeCamera.attachControl(this._attachedElement, this._scene.activeCamera.inputs ? this._scene.activeCamera.inputs.noPreventDefault : true);
         }
     }