Kaynağa Gözat

Fix tiny control3D reason

David Catuhe 7 yıl önce
ebeveyn
işleme
5256fff30c

Dosya farkı çok büyük olduğundan ihmal edildi
+ 14053 - 14053
dist/preview release/babylon.d.ts


+ 1 - 1
dist/preview release/gui/babylon.gui.d.ts

@@ -1022,7 +1022,7 @@ declare module BABYLON.GUI {
          * @param control defines the control to add
          * @returns the current container
          */
-        addControl(control: Control): Container;
+        addControl(control: Nullable<Control>): Container;
         /**
          * Removes a control from the current container
          * @param control defines the control to remove

+ 3 - 0
dist/preview release/gui/babylon.gui.js

@@ -2925,6 +2925,9 @@ var BABYLON;
              * @returns the current container
              */
             Container.prototype.addControl = function (control) {
+                if (!control) {
+                    return this;
+                }
                 var index = this._children.indexOf(control);
                 if (index !== -1) {
                     return this;

Dosya farkı çok büyük olduğundan ihmal edildi
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


+ 1 - 1
dist/preview release/gui/babylon.gui.module.d.ts

@@ -1027,7 +1027,7 @@ declare module BABYLON.GUI {
          * @param control defines the control to add
          * @returns the current container
          */
-        addControl(control: Control): Container;
+        addControl(control: Nullable<Control>): Container;
         /**
          * Removes a control from the current container
          * @param control defines the control to remove

+ 5 - 1
gui/src/2D/controls/container.ts

@@ -131,7 +131,11 @@ module BABYLON.GUI {
          * @param control defines the control to add
          * @returns the current container
          */
-        public addControl(control: Control): Container {
+        public addControl(control: Nullable<Control>): Container {
+            if (!control) {
+                return this;
+            }
+
            var index = this._children.indexOf(control);
 
             if (index !== -1) {