David Catuhe 7 years ago
parent
commit
288e8c883c

File diff suppressed because it is too large
+ 5588 - 5588
dist/preview release/babylon.d.ts


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

@@ -2245,6 +2245,7 @@ declare module BABYLON.GUI {
          * Gets or sets the texture scale ratio used to render content (2 by default)
          */
         contentScaleRatio: number;
+        protected _disposeFaceTexture(): void;
         private _resetContent();
         /**
          * Creates a new button

+ 9 - 2
dist/preview release/gui/babylon.gui.js

@@ -6510,6 +6510,9 @@ var BABYLON;
                 this._rootContainer._host = this;
                 // Events
                 this._pointerObserver = this._scene.onPrePointerObservable.add(function (pi, state) {
+                    if (pi.skipOnPointerObservable) {
+                        return;
+                    }
                     var pointerEvent = (pi.event);
                     if (_this._scene.isPointerCaptured(pointerEvent.pointerId)) {
                         return;
@@ -7456,11 +7459,14 @@ var BABYLON;
                 enumerable: true,
                 configurable: true
             });
-            Button3D.prototype._resetContent = function () {
+            Button3D.prototype._disposeFaceTexture = function () {
                 if (this._facadeTexture) {
                     this._facadeTexture.dispose();
                     this._facadeTexture = null;
                 }
+            };
+            Button3D.prototype._resetContent = function () {
+                this._disposeFaceTexture();
                 this.content = this._content;
             };
             Object.defineProperty(Button3D.prototype, "content", {
@@ -7524,6 +7530,7 @@ var BABYLON;
              */
             Button3D.prototype.dispose = function () {
                 _super.prototype.dispose.call(this);
+                this._disposeFaceTexture();
                 if (this._currentMaterial) {
                     this._currentMaterial.dispose();
                 }
@@ -7570,7 +7577,6 @@ var BABYLON;
                 return _this;
             }
             Object.defineProperty(HolographicButton.prototype, "text", {
-                // private _imageUrl: string;
                 /**
                  * Gets or sets text for the button
                  */
@@ -7648,6 +7654,7 @@ var BABYLON;
                 return "HolographicButton";
             };
             HolographicButton.prototype._rebuildContent = function () {
+                this._disposeFaceTexture();
                 var panel = new GUI.StackPanel();
                 panel.isVertical = true;
                 if (this._imageUrl) {

File diff suppressed because it is too large
+ 2 - 2
dist/preview release/gui/babylon.gui.min.js


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

@@ -2250,6 +2250,7 @@ declare module BABYLON.GUI {
          * Gets or sets the texture scale ratio used to render content (2 by default)
          */
         contentScaleRatio: number;
+        protected _disposeFaceTexture(): void;
         private _resetContent();
         /**
          * Creates a new button

File diff suppressed because it is too large
+ 5 - 5
dist/preview release/inspector/babylon.inspector.bundle.js


+ 9 - 3
gui/src/3D/controls/button3D.ts

@@ -42,13 +42,17 @@ module BABYLON.GUI {
 
             this._contentScaleRatio = value;
             this._resetContent();
-        }        
-
-        private _resetContent() {
+        }   
+        
+        protected _disposeFaceTexture() {
             if (this._facadeTexture) {
                 this._facadeTexture.dispose();
                 this._facadeTexture = null;
             }
+        }
+
+        private _resetContent() {
+            this._disposeFaceTexture();
             this.content = this._content;
         }
 
@@ -161,6 +165,8 @@ module BABYLON.GUI {
         public dispose() {
             super.dispose();
 
+            this._disposeFaceTexture();
+
             if (this._currentMaterial) {
                 this._currentMaterial.dispose();
             }

+ 2 - 2
gui/src/3D/controls/holographicButton.ts

@@ -16,8 +16,6 @@ module BABYLON.GUI {
         private _plateMaterial: StandardMaterial;
         private _pickedPointObserver: Nullable<Observer<Nullable<Vector3>>>;
 
-        // private _imageUrl: string;
-
         /**
          * Gets or sets text for the button
          */
@@ -108,6 +106,8 @@ module BABYLON.GUI {
         }        
 
         private _rebuildContent(): void {
+            this._disposeFaceTexture();
+
             let panel = new StackPanel();
             panel.isVertical = true;
 

+ 5 - 0
gui/src/3D/gui3DManager.ts

@@ -57,6 +57,11 @@ module BABYLON.GUI {
             
             // Events
             this._pointerObserver = this._scene.onPrePointerObservable.add((pi, state) => {
+
+                if (pi.skipOnPointerObservable) {
+                    return;
+                }
+
                 let pointerEvent = <PointerEvent>(pi.event);
                 if (this._scene.isPointerCaptured(pointerEvent.pointerId)) {
                     return;