This commit is contained in:
Dragon Fire
2024-05-03 10:28:55 -04:00
parent e92f705824
commit 6dbd29cb03
158 changed files with 158 additions and 159 deletions
+1 -2
View File
@@ -201,8 +201,7 @@ module.exports = class CanvasUtil {
const lines = text.split('\n');
let currentY = y;
for (const line of lines) {
if (maxLen) ctx.fillText(line, x, currentY, maxLen);
else ctx.fillText(line, x, currentY);
ctx.fillText(line, x, currentY, maxLen);
const metrics = ctx.measureText(line);
currentY += metrics.emHeightAscent + metrics.emHeightDescent;
}