From 8d63c7f52b16667550121924452be72b87339dbe Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 29 Mar 2024 17:02:20 -0400 Subject: [PATCH] Fix --- commands/pokedex/pokedex-box-sprite.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/pokedex/pokedex-box-sprite.js b/commands/pokedex/pokedex-box-sprite.js index 7c0368f5..1a375f49 100644 --- a/commands/pokedex/pokedex-box-sprite.js +++ b/commands/pokedex/pokedex-box-sprite.js @@ -72,7 +72,9 @@ module.exports = class PokedexBoxSpriteCommand extends Command { const x = 40 * (this.id % 12); const y = Math.floor(this.id / 12) * 30; ctx.imageSmoothingEnabled = false; - ctx.drawImage(this.client.pokemon.sprites, x, y, 40, 30, 0, 0, 250, 250); + const ratio = 250 / 30; + const height = 30 * ratio; + ctx.drawImage(this.client.pokemon.sprites, x, y, 40, 30, 0, 0, 250, height); cropToContent(ctx, canvas, canvas.width, canvas.height); return msg.say(`#${pokemon.displayID} - ${pokemon.name}`, { files: [{