Browse Source

Fix Text rendering on texture. (#503)

Pavel Alexandrov 6 năm trước cách đây
mục cha
commit
4a13642a65
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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;