From 72c34d6384c8641fa279817aed9bec72b872becd Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 4 Jul 2020 23:51:20 -0400 Subject: [PATCH] Fix --- commands/edit-image/caution.js | 2 +- commands/edit-image/danger.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/edit-image/caution.js b/commands/edit-image/caution.js index a057b3c0..77c94186 100644 --- a/commands/edit-image/caution.js +++ b/commands/edit-image/caution.js @@ -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`; } diff --git a/commands/edit-image/danger.js b/commands/edit-image/danger.js index 613b4e09..f97444fe 100644 --- a/commands/edit-image/danger.js +++ b/commands/edit-image/danger.js @@ -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);