Переглянути джерело

Fix issue with input.detachControl

David Catuhe 7 роки тому
батько
коміт
578a54b1d0

Різницю між файлами не показано, бо вона завелика
+ 1230 - 1230
dist/preview release/babylon.d.ts


Різницю між файлами не показано, бо вона завелика
+ 7 - 7
dist/preview release/babylon.js


+ 2 - 2
dist/preview release/babylon.max.js

@@ -36131,7 +36131,7 @@ var BABYLON;
         CameraInputsManager.prototype.remove = function (inputToRemove) {
             for (var cam in this.attached) {
                 var input = this.attached[cam];
-                if (input === inputToRemove && this.attachedElement) {
+                if (input === inputToRemove) {
                     input.detachControl(this.attachedElement);
                     input.camera = null;
                     delete this.attached[cam];
@@ -36142,7 +36142,7 @@ var BABYLON;
         CameraInputsManager.prototype.removeByType = function (inputType) {
             for (var cam in this.attached) {
                 var input = this.attached[cam];
-                if (input.getClassName() === inputType && this.attachedElement) {
+                if (input.getClassName() === inputType) {
                     input.detachControl(this.attachedElement);
                     input.camera = null;
                     delete this.attached[cam];

Різницю між файлами не показано, бо вона завелика
+ 1230 - 1230
dist/preview release/babylon.module.d.ts


Різницю між файлами не показано, бо вона завелика
+ 7 - 7
dist/preview release/babylon.worker.js


Різницю між файлами не показано, бо вона завелика
+ 1194 - 1194
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


Різницю між файлами не показано, бо вона завелика
+ 7 - 7
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


+ 2 - 2
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js

@@ -36131,7 +36131,7 @@ var BABYLON;
         CameraInputsManager.prototype.remove = function (inputToRemove) {
             for (var cam in this.attached) {
                 var input = this.attached[cam];
-                if (input === inputToRemove && this.attachedElement) {
+                if (input === inputToRemove) {
                     input.detachControl(this.attachedElement);
                     input.camera = null;
                     delete this.attached[cam];
@@ -36142,7 +36142,7 @@ var BABYLON;
         CameraInputsManager.prototype.removeByType = function (inputType) {
             for (var cam in this.attached) {
                 var input = this.attached[cam];
-                if (input.getClassName() === inputType && this.attachedElement) {
+                if (input.getClassName() === inputType) {
                     input.detachControl(this.attachedElement);
                     input.camera = null;
                     delete this.attached[cam];

Різницю між файлами не показано, бо вона завелика
+ 1194 - 1194
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


+ 3 - 3
src/Cameras/babylon.cameraInputsManager.ts

@@ -6,7 +6,7 @@ module BABYLON {
         getClassName(): string;
         getSimpleName(): string;
         attachControl: (element: HTMLElement, noPreventDefault?: boolean) => void;
-        detachControl: (element: HTMLElement) => void;
+        detachControl: (element: Nullable<HTMLElement>) => void;
         checkInputs?: () => void;
     }
 
@@ -53,7 +53,7 @@ module BABYLON {
         public remove(inputToRemove: ICameraInput<TCamera>) {
             for (var cam in this.attached) {
                 var input = this.attached[cam];
-                if (input === inputToRemove && this.attachedElement) {
+                if (input === inputToRemove) {
                     input.detachControl(this.attachedElement);
                     input.camera = null;
                     delete this.attached[cam];
@@ -65,7 +65,7 @@ module BABYLON {
         public removeByType(inputType: string) {
             for (var cam in this.attached) {
                 var input = this.attached[cam];
-                if (input.getClassName() === inputType && this.attachedElement) {
+                if (input.getClassName() === inputType) {
                     input.detachControl(this.attachedElement);
                     input.camera = null;
                     delete this.attached[cam];