From e6dba6e62250ca27a9f90ca3c3862fac1b35c26c Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Wed, 10 Feb 2021 21:17:25 -0500 Subject: [PATCH] Fix --- commands/edit-avatar/eject.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/commands/edit-avatar/eject.js b/commands/edit-avatar/eject.js index 25a77a4d..ab8f1da3 100644 --- a/commands/edit-avatar/eject.js +++ b/commands/edit-avatar/eject.js @@ -84,14 +84,16 @@ module.exports = class EjectCommand extends Command { ctx.drawImage(avatar, x, (frame.height / 2) - 25, 50, 50); ctx.rotate(-rotation * (Math.PI / 180)); } - if (i > 10 && i <= 20) { - ctx.drawImage(frame, 0, 0); - const letters = Math.ceil((text.length / 10) * ((i - 10) + 1)); - const toDraw = text.slice(0, letters + 1); - ctx.fillText(toDraw, frame.width / 2, frame.height / 2, 300); - } else { - ctx.drawImage(frame, 0, 0); - ctx.fillText(text, frame.width / 2, frame.height / 2, 300); + if (i > 10) { + if (i <= 20) { + ctx.drawImage(frame, 0, 0); + const letters = Math.ceil((text.length / 10) * ((i - 10) + 1)); + const toDraw = text.slice(0, letters + 1); + ctx.fillText(toDraw, frame.width / 2, frame.height / 2, 300); + } else { + ctx.drawImage(frame, 0, 0); + ctx.fillText(text, frame.width / 2, frame.height / 2, 300); + } } encoder.addFrame(ctx); }