From 598eb894354f3b1e607367c9f3f5994d08e9bd21 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 20 Feb 2021 11:30:35 -0500 Subject: [PATCH] Fix --- commands/edit-image/font.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/edit-image/font.js b/commands/edit-image/font.js index c3c292a7..f3f38b62 100644 --- a/commands/edit-image/font.js +++ b/commands/edit-image/font.js @@ -33,7 +33,7 @@ module.exports = class FontCommand extends Command { const canvasPre = createCanvas(1, 1); const ctxPre = canvasPre.getContext('2d'); ctxPre.font = this.client.fonts.get(font.filename).toCanvasString(75); - const len = ctx.measureText(text); + const len = ctxPre.measureText(text); const lines = wrapText(ctxPre, text, 450); const canvas = createCanvas(Math.min(len, 500), 50 + (75 * lines.length)); const ctx = canvas.getContext('2d');