Fix buttons width

This commit is contained in:
Dragon Fire
2020-05-23 12:19:06 -04:00
parent baf3d566e5
commit 37122dc44a
+2 -2
View File
@@ -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' }] });
}