Browse Source

Update babylon.dynamicTexture.ts

aWeirdo 8 years ago
parent
commit
89a23b1a6a
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Materials/Textures/babylon.dynamicTexture.ts

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

@@ -75,11 +75,11 @@ module BABYLON {
             }
 
             this._context.font = font;
-            if (x === null) {
+            if (x === null  || typeof x === "undefined") {
                 var textSize = this._context.measureText(text);
                 x = (size.width - textSize.width) / 2;
             }
-            if (y === null) {
+            if (y === null || typeof y === "undefined") {
                 var fontSize = parseInt((font.replace(/\D/g,'')));;
                 y = (size.height /2) + (fontSize/3.65);
             }