fix empty line for label ttf

This commit is contained in:
Huabing.Xu
2016-01-13 11:00:54 +08:00
parent 305055a114
commit 810b70e59a
@@ -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){