mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 00:06:42 +02:00
Fix buttons width
This commit is contained in:
@@ -64,7 +64,7 @@ module.exports = class TwoButtonsCommand extends Command {
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const firstLines = await wrapText(ctx, first, 183);
|
||||
ctx.fillText(firstLines.join('\n'), 45, 111);
|
||||
ctx.fillText(firstLines.join('\n'), 20, 111);
|
||||
ctx.font = '34px Noto';
|
||||
fontSize = 34;
|
||||
while (ctx.measureText(second).width > 163) {
|
||||
@@ -72,7 +72,7 @@ module.exports = class TwoButtonsCommand extends Command {
|
||||
ctx.font = `${fontSize}px Noto`;
|
||||
}
|
||||
const secondLines = await wrapText(ctx, second, 122);
|
||||
ctx.fillText(secondLines.join('\n'), 274, 120);
|
||||
ctx.fillText(secondLines.join('\n'), 249, 120);
|
||||
ctx.rotate(12 * (Math.PI / 180));
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'two-buttons.png' }] });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user