Browse Source

Fixed bug with sprites and delayed loading

David Catuhe 9 năm trước cách đây
mục cha
commit
bfe457fed0

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/babylon.core.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 772 - 772
dist/preview release/babylon.d.ts


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/babylon.js


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

@@ -20179,7 +20179,7 @@ var BABYLON;
             return { width: 0, height: 0 };
         };
         BaseTexture.prototype.getBaseSize = function () {
-            if (!this.isReady())
+            if (!this.isReady() || !this._texture)
                 return { width: 0, height: 0 };
             if (this._texture._size) {
                 return { width: this._texture._size, height: this._texture._size };

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
dist/preview release/babylon.noworker.js


+ 1 - 1
src/Materials/Textures/babylon.baseTexture.js

@@ -54,7 +54,7 @@ var BABYLON;
             return { width: 0, height: 0 };
         };
         BaseTexture.prototype.getBaseSize = function () {
-            if (!this.isReady())
+            if (!this.isReady() || !this._texture)
                 return { width: 0, height: 0 };
             if (this._texture._size) {
                 return { width: this._texture._size, height: this._texture._size };

+ 1 - 1
src/Materials/Textures/babylon.baseTexture.ts

@@ -90,7 +90,7 @@
         }
 
         public getBaseSize(): ISize {
-            if (!this.isReady())
+            if (!this.isReady() || !this._texture)
                 return { width: 0, height: 0 };
 
             if (this._texture._size) {