Do Radians right

This commit is contained in:
Daniel Odendahl Jr
2017-09-02 00:37:46 +00:00
parent 36fcc4db33
commit 7789dab718
5 changed files with 9 additions and 8 deletions
+2 -2
View File
@@ -41,9 +41,9 @@ module.exports = class BobRossCommand extends Command {
const avatar = await loadImage(body);
ctx.fillStyle = 'white';
ctx.fillRect(0, 0, 600, 775);
ctx.rotate(3 * Math.PI / 180);
ctx.rotate(3 * (Math.PI / 180));
ctx.drawImage(avatar, 69, 102, 256, 256);
ctx.rotate(-3 * Math.PI / 180);
ctx.rotate(-3 * (Math.PI / 180));
ctx.drawImage(base, 0, 0);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'bob-ross.png' }] });
} catch (err) {
+2 -2
View File
@@ -39,9 +39,9 @@ module.exports = class DexterCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
const avatar = await loadImage(body);
ctx.drawImage(base, 0, 0);
ctx.rotate(-11 * Math.PI / 180);
ctx.rotate(-11 * (Math.PI / 180));
ctx.drawImage(avatar, 234, 274, 225, 225);
ctx.rotate(11 * Math.PI / 180);
ctx.rotate(11 * (Math.PI / 180));
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'dexter.png' }] });
} catch (err) {
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
+2 -2
View File
@@ -39,9 +39,9 @@ module.exports = class SimbaCommand extends Command {
const { body } = await snekfetch.get(avatarURL);
const avatar = await loadImage(body);
ctx.drawImage(base, 0, 0);
ctx.rotate(-24 * Math.PI / 180);
ctx.rotate(-24 * (Math.PI / 180));
ctx.drawImage(avatar, 75, 160, 130, 150);
ctx.rotate(24 * Math.PI / 180);
ctx.rotate(24 * (Math.PI / 180));
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'simba.png' }] });
} catch (err) {
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);