Merge pull request #239 from dabingnn/fix_labelttf_empty_line

fix empty line for label ttf
This commit is contained in:
pandamicro
2016-01-14 20:03:03 +08:00
@@ -82,6 +82,11 @@
//check the first character
var wrappedWords = [];
//fast return if strArr is empty
if(strArr.length === 0) {
wrappedWords.push("");
return wrappedWords;
}
var text = strArr;
var allWidth = ctx.measureText(text).width;
while(allWidth > maxWidth && text.length > 1){