wrapText is no longer async

This commit is contained in:
Dragon Fire
2024-04-26 00:27:42 -04:00
parent fcaa13c576
commit aa78cd91c2
41 changed files with 53 additions and 53 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ module.exports = class SubtitleCommand extends Command {
ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(fontSize);
ctx.fillStyle = 'yellow';
ctx.textAlign = 'center';
const lines = await wrapText(ctx, text, base.width - 10);
const lines = wrapText(ctx, text, base.width - 10);
if (!lines) return msg.reply('There\'s not enough width to subtitle this image.');
ctx.textBaseline = 'bottom';
const initial = base.height - ((lines.length - 1) * fontSize) - (fontSize / 2) - ((lines.length - 1) * 10);
+1 -1
View File
@@ -138,7 +138,7 @@ module.exports = class YuGiOhGenCommand extends Command {
}
const font = monsterType === 'normal' ? 'Stone Serif LT Italic.ttf' : 'Matrix Book.ttf';
ctx.font = this.client.fonts.get(font).toCanvasString(27);
const wrappedEffect = await wrapText(ctx, effect, 690);
const wrappedEffect = wrapText(ctx, effect, 690);
const trimmed = wrappedEffect.slice(0, type === 'monster' ? 4 : 6);
ctx.fillText(trimmed.join('\n'), 63, 933 - (type === 'monster' ? 0 : 34));
ctx.font = this.client.fonts.get('Stone Serif.ttf').toCanvasString(22);