mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Fix
This commit is contained in:
+1
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user