mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 15:57:50 +02:00
Fix
This commit is contained in:
@@ -51,7 +51,7 @@ module.exports = class CautionCommand extends Command {
|
||||
ctx.textBaseline = 'top';
|
||||
ctx.font = 'normal bold 60px Noto';
|
||||
let fontSize = 60;
|
||||
while (ctx.measureText(text).width > 3580) {
|
||||
while (ctx.measureText(text).width > 3311) {
|
||||
fontSize--;
|
||||
ctx.font = `normal bold ${fontSize}px Noto`;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ module.exports = class DangerCommand extends Command {
|
||||
fontSize--;
|
||||
ctx.font = `normal bold ${fontSize}px Noto`;
|
||||
}
|
||||
const lines = await wrapText(ctx, text.toUpperCase(), 320);
|
||||
const lines = await wrapText(ctx, text.toUpperCase(), 840);
|
||||
const topMost = 510 - (((fontSize * lines.length) / 2) + ((20 * (lines.length - 1)) / 2));
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const height = topMost + ((fontSize + 20) * i);
|
||||
|
||||
Reference in New Issue
Block a user