mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user