From 3fe4545a50763053029c24148da977a565130fda Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Fri, 8 Feb 2019 16:40:51 +0000 Subject: [PATCH] Fix --- commands/image-edit/meme-gen.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/image-edit/meme-gen.js b/commands/image-edit/meme-gen.js index 1fcd5996..b9b96fa9 100644 --- a/commands/image-edit/meme-gen.js +++ b/commands/image-edit/meme-gen.js @@ -60,8 +60,9 @@ module.exports = class MemeGenCommand extends Command { } const bottomLines = await wrapText(ctx, bottom, base.width - 10); ctx.textBaseline = 'bottom'; + const initial = base.height - ((bottomLines.length - 1) * fontSize) + ((bottomLines.length - 1) * 10); for (let i = 0; i < bottomLines.length; i++) { - const textHeight = base.height - (i * fontSize) - (i * 10); + const textHeight = initial + (i * fontSize) + (i * 10); ctx.fillText(bottomLines[i], base.width / 2, textHeight); } const attachment = canvas.toBuffer();