瀏覽代碼

Fix isVIsible for GUI containers

David Catuhe 8 年之前
父節點
當前提交
1fd8f84a6f

文件差異過大導致無法顯示
+ 2727 - 2727
dist/preview release/babylon.d.ts


文件差異過大導致無法顯示
+ 2727 - 2727
dist/preview release/babylon.module.d.ts


文件差異過大導致無法顯示
+ 2205 - 2205
dist/preview release/customConfigurations/minimalViewer/babylon.d.ts


文件差異過大導致無法顯示
+ 2205 - 2205
dist/preview release/customConfigurations/minimalViewer/babylon.module.d.ts


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

@@ -1603,6 +1603,9 @@ var BABYLON;
                 }
             };
             Container.prototype._draw = function (parentMeasure, context) {
+                if (!this.isVisible) {
+                    return;
+                }
                 context.save();
                 this._applyStates(context);
                 if (this._processMeasures(parentMeasure, context)) {
@@ -1618,6 +1621,9 @@ var BABYLON;
                 context.restore();
             };
             Container.prototype._processPicking = function (x, y, type) {
+                if (!this.isHitTestVisible || !this.isVisible) {
+                    return false;
+                }
                 if (!_super.prototype.contains.call(this, x, y)) {
                     return false;
                 }

文件差異過大導致無法顯示
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


+ 7 - 0
gui/src/controls/container.ts

@@ -127,6 +127,9 @@ module BABYLON.GUI {
         }
 
         public _draw(parentMeasure: Measure, context: CanvasRenderingContext2D): void {      
+            if (!this.isVisible) {
+                return;
+            }
             context.save();
            
             this._applyStates(context);
@@ -145,6 +148,10 @@ module BABYLON.GUI {
         }
 
         public _processPicking(x: number, y: number, type: number): boolean {
+            if (!this.isHitTestVisible || !this.isVisible) {
+                return false;
+            }
+
             if (!super.contains(x, y)) {
                 return false;
             }