This commit is contained in:
Dragon Fire
2020-05-24 16:26:23 -04:00
parent 5417505525
commit c31f4fc344
+14 -14
View File
@@ -66,36 +66,36 @@ module.exports = class TweetCommand extends Command {
ctx.textBaseline = 'top'; ctx.textBaseline = 'top';
ctx.font = 'normal bold 18px Noto'; ctx.font = 'normal bold 18px Noto';
ctx.fillStyle = 'white'; ctx.fillStyle = 'white';
ctx.fillText(userData.name, 105, 95); ctx.fillText(userData.name, 105, 88);
ctx.font = '17px Noto'; ctx.font = '17px Noto';
ctx.fillStyle = '#8899a6'; ctx.fillStyle = '#8899a6';
ctx.fillText(userData.screenName, 106, 118); ctx.fillText(`@${userData.screenName}`, 106, 111);
ctx.fillStyle = 'white'; ctx.fillStyle = 'white';
ctx.font = '23px Noto'; ctx.font = '23px Noto';
const lines = await wrapText(ctx, text, 710); 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.fillStyle = '#8899a6';
ctx.font = '18px Noto'; 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.font = '16px Noto';
ctx.fillText(this.formatNumber(replies), 87, 470); ctx.fillText(this.formatNumber(replies), 87, 463);
ctx.fillText(this.formatNumber(likes), 509, 470); ctx.fillText(this.formatNumber(likes), 509, 463);
ctx.fillText(this.formatNumber(retweets), 300, 470); ctx.fillText(this.formatNumber(retweets), 300, 463);
ctx.fillStyle = 'white'; ctx.fillStyle = 'white';
ctx.font = 'normal bold 18px Noto'; ctx.font = 'normal bold 18px Noto';
ctx.fillText(this.formatNumber(retweets), 31, 407); ctx.fillText(this.formatNumber(retweets), 31, 400);
const retweetsLen = ctx.measureText(this.formatNumber(retweets)); const retweetsLen = ctx.measureText(this.formatNumber(retweets)).width;
ctx.fillStyle = '#8899a6'; ctx.fillStyle = '#8899a6';
ctx.font = '18px Noto'; ctx.font = '18px Noto';
ctx.fillText('Retweets', 31 + retweetsLen + 5, 407); ctx.fillText('Retweets', 31 + retweetsLen + 5, 400);
const retweetsWordLen = ctx.measureText('Retweets'); const retweetsWordLen = ctx.measureText('Retweets').width;
ctx.fillStyle = 'white'; ctx.fillStyle = 'white';
ctx.font = 'normal bold 18px Noto'; ctx.font = 'normal bold 18px Noto';
ctx.fillText(this.formatNumber(likes), 31 + retweetsLen + 5 + retweetsWordLen + 10, 407); ctx.fillText(this.formatNumber(likes), 31 + retweetsLen + 5 + retweetsWordLen + 10, 400);
const likesLen = ctx.measureText(this.formatNumber(likes)); const likesLen = ctx.measureText(this.formatNumber(likes)).width;
ctx.fillStyle = '#8899a6'; ctx.fillStyle = '#8899a6';
ctx.font = '18px Noto'; 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.beginPath();
ctx.arc(30 + 32, 84 + 32, 32, 0, Math.PI * 2); ctx.arc(30 + 32, 84 + 32, 32, 0, Math.PI * 2);
ctx.closePath(); ctx.closePath();