This commit is contained in:
Dragon Fire
2021-02-10 21:17:25 -05:00
parent 35cbad074e
commit e6dba6e622
+10 -8
View File
@@ -84,14 +84,16 @@ module.exports = class EjectCommand extends Command {
ctx.drawImage(avatar, x, (frame.height / 2) - 25, 50, 50); ctx.drawImage(avatar, x, (frame.height / 2) - 25, 50, 50);
ctx.rotate(-rotation * (Math.PI / 180)); ctx.rotate(-rotation * (Math.PI / 180));
} }
if (i > 10 && i <= 20) { if (i > 10) {
ctx.drawImage(frame, 0, 0); if (i <= 20) {
const letters = Math.ceil((text.length / 10) * ((i - 10) + 1)); ctx.drawImage(frame, 0, 0);
const toDraw = text.slice(0, letters + 1); const letters = Math.ceil((text.length / 10) * ((i - 10) + 1));
ctx.fillText(toDraw, frame.width / 2, frame.height / 2, 300); const toDraw = text.slice(0, letters + 1);
} else { ctx.fillText(toDraw, frame.width / 2, frame.height / 2, 300);
ctx.drawImage(frame, 0, 0); } else {
ctx.fillText(text, frame.width / 2, frame.height / 2, 300); ctx.drawImage(frame, 0, 0);
ctx.fillText(text, frame.width / 2, frame.height / 2, 300);
}
} }
encoder.addFrame(ctx); encoder.addFrame(ctx);
} }