mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 14:19:56 +02:00
Make square avatars rounded
This commit is contained in:
@@ -197,6 +197,9 @@ module.exports = class TweetCommand extends Command {
|
|||||||
ctx.arc(17 + 26, 84 + 26, 26, 0, Math.PI * 2);
|
ctx.arc(17 + 26, 84 + 26, 26, 0, Math.PI * 2);
|
||||||
ctx.closePath();
|
ctx.closePath();
|
||||||
ctx.clip();
|
ctx.clip();
|
||||||
|
} else {
|
||||||
|
this.roundedPath(ctx, 10, 17, 84, 52, 52);
|
||||||
|
ctx.clip();
|
||||||
}
|
}
|
||||||
ctx.drawImage(avatar, 17, 84, 52, 52);
|
ctx.drawImage(avatar, 17, 84, 52, 52);
|
||||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'tweet.png' }] });
|
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'tweet.png' }] });
|
||||||
|
|||||||
Reference in New Issue
Block a user