From 5c93c66a2351e5030c92b0282a405814226a04b8 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Tue, 14 Jul 2020 10:05:40 -0400 Subject: [PATCH] Fix --- commands/edit-meme/illegal.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/edit-meme/illegal.js b/commands/edit-meme/illegal.js index dc44b74d..3ceeeb70 100644 --- a/commands/edit-meme/illegal.js +++ b/commands/edit-meme/illegal.js @@ -71,9 +71,9 @@ module.exports = class IllegalCommand extends Command { ctx.textBaseline = 'top'; ctx.font = '20px Impact'; ctx.textAlign = 'center'; - const widthMid = frame.corners[2][1] - frame.corners[0][1]; - const heightMid = frame.corners[2][0] - frame.corners[0][0]; - const maxLen = frame.corners[0][1] - frame.corners[2][1]; + const maxLen = frame.corners[2][0] - frame.corners[0][0]; + const widthMid = frame.corners[0][0] + (maxLen / 2); + const heightMid = frame.corners[0][1] + ((frame.corners[2][1] - frame.corners[0][1]) / 2); console.log(widthMid, 'x', heightMid, 'x', maxLen); ctx.fillText(`${text}\n${verb} NOW\nILLEGAL`, widthMid, heightMid, maxLen); encoder.addFrame(ctx);