Jelajahi Sumber

Merge pull request #4136 from finscn/fix-wrong-checking

Fix one bug about DynamicTexture's size
David Catuhe 7 tahun lalu
induk
melakukan
73fa86c97f
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      src/Materials/Textures/babylon.dynamicTexture.ts

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

@@ -35,7 +35,7 @@
             } else {
             } else {
                 this._canvas = document.createElement("canvas");
                 this._canvas = document.createElement("canvas");
 
 
-                if (options.width) {
+                if (options.width || options.width === 0) {
                     this._texture = this._engine.createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode);
                     this._texture = this._engine.createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode);
                 } else {
                 } else {
                     this._texture = this._engine.createDynamicTexture(options, options, generateMipMaps, samplingMode);
                     this._texture = this._engine.createDynamicTexture(options, options, generateMipMaps, samplingMode);