From 61b5f78cf3596c173ae29013e911f42cc34db00b Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 26 Apr 2024 20:50:00 -0400 Subject: [PATCH] Fix --- commands/edit-image-text/tweet.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/edit-image-text/tweet.js b/commands/edit-image-text/tweet.js index b280ae4d..70ddbff2 100644 --- a/commands/edit-image-text/tweet.js +++ b/commands/edit-image-text/tweet.js @@ -210,18 +210,18 @@ module.exports = class TweetCommand extends Command { this.fillHashtags(ctx, wrapped, x, y, emojiSize); return ctx; } + let currentY = y; for (let currentLine = 0; currentLine < wrapped.length; currentLine++) { const line = wrapped[currentLine]; - const lineNoEmoji = line.split(emojiRegex()); const lineEmoji = line.match(emojiRegex()); let currentX = x; - let currentY = y; const metrics = ctx.measureText(line); if (!lineEmoji) { ctx.fillText(line, x, currentY); currentY += metrics.emHeightAscent + metrics.emHeightDescent; continue; } + const lineNoEmoji = line.split(emojiRegex()); for (let i = 0; i < lineNoEmoji.length; i++) { const linePart = lineNoEmoji[i]; ctx.fillText(linePart, currentX, currentY);