瀏覽代碼

Merge pull request #76 from darkdarkdragon/proposed2

made Label (<span>) to obey size of container
Nicolas Cannasse 10 年之前
父節點
當前提交
c64db6e179
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      h2d/comp/Label.hx

+ 1 - 0
h2d/comp/Label.hx

@@ -23,6 +23,7 @@ class Label extends Component {
 
 	override function resize( ctx : Context ) {
 		if( ctx.measure ) {
+            tf.maxWidth = ctx.maxWidth;
 			tf.font = getFont();
 			tf.textColor = style.color;
 			tf.text = text;