瀏覽代碼

Fix Text rendering on texture. (#503)

Pavel Alexandrov 6 年之前
父節點
當前提交
4a13642a65
共有 1 個文件被更改,包括 1 次插入1 次删除
  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;