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