From c31f4fc3442c3d991c931668110f28d2be655b7f Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 24 May 2020 16:26:23 -0400 Subject: [PATCH] Fix --- commands/edit-image/tweet.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/commands/edit-image/tweet.js b/commands/edit-image/tweet.js index 4693e5aa..7ccb390e 100644 --- a/commands/edit-image/tweet.js +++ b/commands/edit-image/tweet.js @@ -66,36 +66,36 @@ module.exports = class TweetCommand extends Command { ctx.textBaseline = 'top'; ctx.font = 'normal bold 18px Noto'; ctx.fillStyle = 'white'; - ctx.fillText(userData.name, 105, 95); + ctx.fillText(userData.name, 105, 88); ctx.font = '17px Noto'; ctx.fillStyle = '#8899a6'; - ctx.fillText(userData.screenName, 106, 118); + ctx.fillText(`@${userData.screenName}`, 106, 111); ctx.fillStyle = 'white'; ctx.font = '23px Noto'; const lines = await wrapText(ctx, text, 710); - ctx.fillText(lines.join('\n'), 32, 171); + ctx.fillText(lines.join('\n'), 32, 164); ctx.fillStyle = '#8899a6'; ctx.font = '18px Noto'; - ctx.fillText(moment().format('h:mm A ∙ MMMM D, YYYY'), 31, 282); + ctx.fillText(moment().format('h:mm A ∙ MMMM D, YYYY'), 31, 275); ctx.font = '16px Noto'; - ctx.fillText(this.formatNumber(replies), 87, 470); - ctx.fillText(this.formatNumber(likes), 509, 470); - ctx.fillText(this.formatNumber(retweets), 300, 470); + ctx.fillText(this.formatNumber(replies), 87, 463); + ctx.fillText(this.formatNumber(likes), 509, 463); + ctx.fillText(this.formatNumber(retweets), 300, 463); ctx.fillStyle = 'white'; ctx.font = 'normal bold 18px Noto'; - ctx.fillText(this.formatNumber(retweets), 31, 407); - const retweetsLen = ctx.measureText(this.formatNumber(retweets)); + ctx.fillText(this.formatNumber(retweets), 31, 400); + const retweetsLen = ctx.measureText(this.formatNumber(retweets)).width; ctx.fillStyle = '#8899a6'; ctx.font = '18px Noto'; - ctx.fillText('Retweets', 31 + retweetsLen + 5, 407); - const retweetsWordLen = ctx.measureText('Retweets'); + ctx.fillText('Retweets', 31 + retweetsLen + 5, 400); + const retweetsWordLen = ctx.measureText('Retweets').width; ctx.fillStyle = 'white'; ctx.font = 'normal bold 18px Noto'; - ctx.fillText(this.formatNumber(likes), 31 + retweetsLen + 5 + retweetsWordLen + 10, 407); - const likesLen = ctx.measureText(this.formatNumber(likes)); + ctx.fillText(this.formatNumber(likes), 31 + retweetsLen + 5 + retweetsWordLen + 10, 400); + const likesLen = ctx.measureText(this.formatNumber(likes)).width; ctx.fillStyle = '#8899a6'; ctx.font = '18px Noto'; - ctx.fillText('Likes', 31 + retweetsLen + 5 + retweetsWordLen + 10 + likesLen + 5, 407); + ctx.fillText('Likes', 31 + retweetsLen + 5 + retweetsWordLen + 10 + likesLen + 5, 400); ctx.beginPath(); ctx.arc(30 + 32, 84 + 32, 32, 0, Math.PI * 2); ctx.closePath();