From 2e89e2f559d4c5f31a3e4d9898516cc527528d34 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Wed, 24 Apr 2024 00:18:13 -0400 Subject: [PATCH] Fix --- commands/edit-avatar/matrix.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/edit-avatar/matrix.js b/commands/edit-avatar/matrix.js index 0e6fcbf6..f7fd0c5f 100644 --- a/commands/edit-avatar/matrix.js +++ b/commands/edit-avatar/matrix.js @@ -60,10 +60,10 @@ module.exports = class MatrixCommand extends Command { for (let i = 0; i < frameCount; i++) { const frame = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'matrix', `frame-${i}.gif`)); const ratio = frame.width / frame.height; - const height = Math.round(avatar.width / ratio); + const width = Math.round(avatar.height / ratio); ctx.drawImage(avatar, 0, 0); distort(ctx, 20, 0, 0, avatar.width, avatar.height, 5); - ctx.drawImage(frame, 0, avatar.height - height, avatar.width, height); + ctx.drawImage(frame, avatar.width - width, 0, width, avatar.height); encoder.addFrame(ctx); } encoder.finish();