mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
+6
-10
@@ -225,18 +225,14 @@ module.exports = class CanvasUtil {
|
|||||||
lines.push(line.trim());
|
lines.push(line.trim());
|
||||||
line = `${part} `;
|
line = `${part} `;
|
||||||
}
|
}
|
||||||
if (j < parts.length - 1) {
|
|
||||||
lines.push(line.trim());
|
|
||||||
line = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (ctx.measureText(`${line}${word}`).width <= maxWidth) {
|
|
||||||
line += `${word} `;
|
|
||||||
} else {
|
|
||||||
lines.push(line.trim());
|
lines.push(line.trim());
|
||||||
line = `${word} `;
|
line = '';
|
||||||
}
|
}
|
||||||
|
} else if (ctx.measureText(`${line}${word}`).width <= maxWidth) {
|
||||||
|
line += `${word} `;
|
||||||
|
} else {
|
||||||
|
lines.push(line.trim());
|
||||||
|
line = `${word} `;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lines.push(line.trim());
|
lines.push(line.trim());
|
||||||
|
|||||||
Reference in New Issue
Block a user