mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #2201 from knoxHuang/v1.7-release
fix label warp bug, The first line should not remove the space
This commit is contained in:
@@ -296,18 +296,30 @@ var TextUtils = {
|
||||
sText = text.substr(0, fuzzyLen);
|
||||
}
|
||||
}
|
||||
sText = sText.trim();
|
||||
if (sText.length > 0) {
|
||||
|
||||
// The first line And do not wrap should not remove the space
|
||||
if (wrappedWords.length === 0 && (sLine === '' && tmpText === '')) {
|
||||
wrappedWords.push(sText);
|
||||
}
|
||||
else {
|
||||
sText = sText.trim();
|
||||
if (sText.length > 0) {
|
||||
wrappedWords.push(sText);
|
||||
}
|
||||
}
|
||||
text = sLine || tmpText;
|
||||
allWidth = measureText(text);
|
||||
}
|
||||
text = text.trim();
|
||||
if (text.length > 0) {
|
||||
|
||||
if (wrappedWords.length === 0) {
|
||||
wrappedWords.push(text);
|
||||
}
|
||||
|
||||
else {
|
||||
text = text.trim();
|
||||
if (text.length > 0) {
|
||||
wrappedWords.push(text);
|
||||
}
|
||||
}
|
||||
return wrappedWords;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user