Forráskód Böngészése

Fix one bug about DynamicTexture's size

When create a DynamicTexture with size {width:0, height:number} , the code `if (options.width) { ... }` will take a wrong result.

example : 
in babylon.gui , there is one line  like this : 
```
var result = new AdvancedDynamicTexture(name, 0, 0, scene, false, sampling);
```
the result's size will be {width:0, height:0}

when I use   `result.getSize()` the create a new DynamicTexture , will take some mistakes.
finscn 7 éve
szülő
commit
6aa8deddba
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      src/Materials/Textures/babylon.dynamicTexture.ts

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

@@ -35,7 +35,7 @@
             } else {
                 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);
                 } else {
                     this._texture = this._engine.createDynamicTexture(options, options, generateMipMaps, samplingMode);