Commit d828aa62 by doszhang

dos

parent 2609101c
...@@ -1048,18 +1048,17 @@ function flagTextDraw(ctx, content, fontsize, color, x, y, font = "normal") { ...@@ -1048,18 +1048,17 @@ function flagTextDraw(ctx, content, fontsize, color, x, y, font = "normal") {
let nowLen = 0; let nowLen = 0;
for (let i = 0; i < content.length; i++) { for (let i = 0; i < content.length; i++) {
const tLen = calculateStringLength(content[i]); const tLen = calculateStringLength(content[i]);
if (i == content.length - 1) {
lineArr.push(res);
} else {
if (nowLen + tLen <= wn) { if (nowLen + tLen <= wn) {
res += content[i]; res += content[i];
nowLen += tLen; nowLen += tLen;
if (i == content.length - 1) {
lineArr.push(res);
}
} else { } else {
lineArr.push(res); lineArr.push(res);
res = ''; res = '';
nowLen = 0; nowLen = 0;
} }
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment