Browse Source

Fix Text rendering on texture. (#503)

Pavel Alexandrov 6 years ago
parent
commit
4a13642a65
1 changed files with 1 additions and 1 deletions
  1. 1 1
      h2d/Text.hx

+ 1 - 1
h2d/Text.hx

@@ -100,7 +100,7 @@ class Text extends Drawable {
 			emitTile(ctx, h2d.Tile.fromColor(0xFF00FF, 16, 16));
 			return;
 		}
-		if ( !calcDone ) initGlyphs(text, false);
+		if ( !calcDone && text != null && font != null ) initGlyphs(text);
 
 		if( dropShadow != null ) {
 			var oldX = absX, oldY = absY;