Commit d828aa62 by doszhang

dos

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