From 5c1d6b97235638ca5908be99192e39c3d3231416 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 9 May 2024 16:02:54 -0400 Subject: [PATCH] Fix tweet positioning --- commands/edit-image-text/tweet.js | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/commands/edit-image-text/tweet.js b/commands/edit-image-text/tweet.js index 9a745d1e..603dfc60 100644 --- a/commands/edit-image-text/tweet.js +++ b/commands/edit-image-text/tweet.js @@ -104,11 +104,11 @@ module.exports = class TweetCommand extends Command { const views = randomRange(Math.ceil(userData.followers * 10), Math.ceil(userData.followers * 30)); ctx.drawImage(base1, 0, 0); const base2StartY = base1.height + linesLen + (image ? imageHeight + 15 : 0); - ctx.drawImage(base2, 0, base2StartY); + ctx.drawImage(base2, 0, base2StartY - 1); ctx.textBaseline = 'top'; ctx.font = this.client.fonts.get('ChirpBold.ttf').toCanvasString(18); ctx.fillStyle = 'white'; - ctx.fillText(userData.name, 80, 88); + ctx.fillText(userData.name, 80, 91); const nameLen = ctx.measureText(userData.name).width; if (userData.checkType) { const verified = await loadImage( @@ -132,66 +132,66 @@ module.exports = class TweetCommand extends Command { } ctx.font = this.client.fonts.get('ChirpRegular.ttf').toCanvasString(17); ctx.fillStyle = '#71767b'; - ctx.fillText(`@${userData.screenName}`, 80, 113); + ctx.fillText(`@${userData.screenName}`, 80, 116); ctx.fillStyle = 'white'; ctx.font = this.client.fonts.get('ChirpRegular.ttf').toCanvasString(23); - await this.fillTextWithEmoji(ctx, text, 17, 160, 710, 26); + await this.fillTextWithEmoji(ctx, text, 17, 160, 713, 26); ctx.fillStyle = '#71767b'; ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(18); const time = moment().format('h:mm A ∙ MMM D, YYYY ∙'); - ctx.fillText(time, 18, base2StartY + 12); + ctx.fillText(time, 18, base2StartY + 15); const timeLen = ctx.measureText(time).width; ctx.fillStyle = 'white'; ctx.font = this.client.fonts.get('Noto-Bold.ttf').toCanvasString(18); - ctx.fillText(formatNumberK(views), 18 + timeLen + 6, base2StartY + 12); + ctx.fillText(formatNumberK(views), 18 + timeLen + 6, base2StartY + 15); const viewsLen = ctx.measureText(formatNumberK(views)).width; ctx.fillStyle = '#71767b'; ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(18); - ctx.fillText('Views', 18 + timeLen + 6 + viewsLen + 6, base2StartY + 12); + ctx.fillText('Views', 18 + timeLen + 6 + viewsLen + 6, base2StartY + 15); ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(16); - ctx.fillText(formatNumberK(replies), 64, base2StartY + 145); - ctx.fillText(formatNumberK(likes), 415, base2StartY + 145); - ctx.fillText(formatNumberK(retweets + quotTweets), 242, base2StartY + 145); - ctx.fillText(formatNumberK(bookmarks), 588, base2StartY + 145); + ctx.fillText(formatNumberK(replies), 64, base2StartY + 148); + ctx.fillText(formatNumberK(likes), 415, base2StartY + 148); + ctx.fillText(formatNumberK(retweets + quotTweets), 242, base2StartY + 148); + ctx.fillText(formatNumberK(bookmarks), 588, base2StartY + 148); let currentLen = 17; ctx.fillStyle = 'white'; ctx.font = this.client.fonts.get('Noto-Bold.ttf').toCanvasString(18); - ctx.fillText(formatNumberK(retweets), currentLen, base2StartY + 75); + ctx.fillText(formatNumberK(retweets), currentLen, base2StartY + 78); currentLen += ctx.measureText(formatNumberK(retweets)).width; currentLen += 5; ctx.fillStyle = '#71767b'; ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(18); - ctx.fillText('Reposts', currentLen, base2StartY + 75); + ctx.fillText('Reposts', currentLen, base2StartY + 78); currentLen += ctx.measureText('Reposts').width; currentLen += 10; ctx.fillStyle = 'white'; ctx.font = this.client.fonts.get('Noto-Bold.ttf').toCanvasString(18); - ctx.fillText(formatNumberK(quotTweets), currentLen, base2StartY + 75); + ctx.fillText(formatNumberK(quotTweets), currentLen, base2StartY + 78); currentLen += ctx.measureText(formatNumberK(quotTweets)).width; currentLen += 5; ctx.fillStyle = '#71767b'; ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(18); - ctx.fillText('Quotes', currentLen, base2StartY + 75); + ctx.fillText('Quotes', currentLen, base2StartY + 78); currentLen += ctx.measureText('Quotes').width; currentLen += 10; ctx.fillStyle = 'white'; ctx.font = this.client.fonts.get('Noto-Bold.ttf').toCanvasString(18); - ctx.fillText(formatNumberK(likes), currentLen, base2StartY + 75); + ctx.fillText(formatNumberK(likes), currentLen, base2StartY + 78); currentLen += ctx.measureText(formatNumberK(likes)).width; currentLen += 5; ctx.fillStyle = '#71767b'; ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(18); - ctx.fillText('Likes', currentLen, base2StartY + 75); + ctx.fillText('Likes', currentLen, base2StartY + 78); currentLen += ctx.measureText('Likes').width; currentLen += 10; ctx.fillStyle = 'white'; ctx.font = this.client.fonts.get('Noto-Bold.ttf').toCanvasString(18); - ctx.fillText(formatNumberK(bookmarks), currentLen, base2StartY + 75); + ctx.fillText(formatNumberK(bookmarks), currentLen, base2StartY + 78); currentLen += ctx.measureText(formatNumberK(bookmarks)).width; currentLen += 5; ctx.fillStyle = '#71767b'; ctx.font = this.client.fonts.get('Noto-Regular.ttf').toCanvasString(18); - ctx.fillText('Bookmarks', currentLen, base2StartY + 75); + ctx.fillText('Bookmarks', currentLen, base2StartY + 78); if (userData.avatarShape === 'Circle') { ctx.beginPath(); ctx.arc(17 + 26, 84 + 26, 26, 0, Math.PI * 2);