瀏覽代碼

minor fix for html text wrap

ncannasse 9 年之前
父節點
當前提交
0061425930
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      h2d/Text.hx

+ 4 - 1
h2d/Text.hx

@@ -148,8 +148,11 @@ class Text extends Drawable {
 			} else
 				prevChar = cc;
 		}
-		if( restPos < text.length )
+		if( restPos < text.length ) {
+			if( lines.length == 0 && leftMargin > 0 && x > maxWidth )
+				lines.push("");
 			lines.push(text.substr(restPos, text.length - restPos));
+		}
 		return lines.join("\n");
 	}