mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
fix empty line for label ttf
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user