Commit d828aa62 by doszhang

dos

parent 2609101c
...@@ -1048,17 +1048,16 @@ function flagTextDraw(ctx, content, fontsize, color, x, y, font = "normal") { ...@@ -1048,17 +1048,16 @@ 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) { if (nowLen + tLen <= wn) {
lineArr.push(res); res += content[i];
} else { nowLen += tLen;
if (nowLen + tLen <= wn) { if (i == content.length - 1) {
res += content[i];
nowLen += tLen;
} else {
lineArr.push(res); lineArr.push(res);
res = '';
nowLen = 0;
} }
} else {
lineArr.push(res);
res = '';
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