浏览代码

hide images when calculcating size (correct baseline)

ncannasse 9 年之前
父节点
当前提交
0e27078872
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      h2d/HtmlText.hx

+ 10 - 0
h2d/HtmlText.hx

@@ -138,4 +138,14 @@ class HtmlText extends Text {
 		return c;
 	}
 
+	override function getBoundsRec( relativeTo : Sprite, out : h2d.col.Bounds, forSize : Bool ) {
+		if( forSize )
+			for( i in images )
+				i.visible = false;
+		super.getBoundsRec(relativeTo, out, forSize);
+		if( forSize )
+			for( i in images )
+				i.visible = true;
+	}
+
 }