From c12112cd1608ad7c39e8e257928667cc4b0165b3 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 26 Apr 2024 01:19:38 -0400 Subject: [PATCH] Fix --- commands/edit-image-text/tweet.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/edit-image-text/tweet.js b/commands/edit-image-text/tweet.js index 89b403e3..b2c6a29a 100644 --- a/commands/edit-image-text/tweet.js +++ b/commands/edit-image-text/tweet.js @@ -207,13 +207,13 @@ module.exports = class TweetCommand extends Command { const lineEmoji = line.match(emojiRegex()); const height = metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent; if (!lineEmoji) { - ctx.fillText(line, x, y + height * currentLine); + ctx.fillText(line, x, y + (height * currentLine)); continue; } let currentX = x; for (let i = 0; i < lineNoEmoji.length; i++) { const linePart = lineNoEmoji[i]; - ctx.fillText(linePart, currentX, y + height * currentLine); + ctx.fillText(linePart, currentX, y + (height * currentLine)); currentX += ctx.measureText(linePart).width; const parsedEmoji = twemoji.parse(emoji[i]); if (!parsedEmoji.length || !parsedEmoji[0].url) continue; @@ -221,7 +221,7 @@ module.exports = class TweetCommand extends Command { const loadedEmoji = await loadImage(body); loadedEmoji.width = emojiSize; loadedEmoji.height = emojiSize; - ctx.drawImage(loadedEmoji, currentX, y + height, emojiSize, emojiSize); + ctx.drawImage(loadedEmoji, currentX, y + (height * currentLine), emojiSize, emojiSize); currentX += emojiSize; } }