From 5c985b92fb1226a00f03128a1262123ee1f79089 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Fri, 14 Sep 2018 02:16:47 +0000 Subject: [PATCH] Fix lint --- commands/image-edit/demotivational-poster.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/commands/image-edit/demotivational-poster.js b/commands/image-edit/demotivational-poster.js index 77b0b5c5..082504b5 100644 --- a/commands/image-edit/demotivational-poster.js +++ b/commands/image-edit/demotivational-poster.js @@ -50,19 +50,18 @@ module.exports = class DemotivationalPosterCommand extends Command { const ctx = canvas.getContext('2d'); ctx.fillStyle = 'black'; ctx.fillRect(0, 0, canvas.width, canvas.height); - let width = data.width; - let height = data.height; + let { width, height } = data; const maxWidth = 602; if (width > maxWidth) { const ratio = maxWidth / width; width = maxWidth; - height = height * ratio; + height *= ratio; } const maxHeight = 402; if (height > maxHeight) { const ratio = maxHeight / height; height = maxHeight; - width = width * ratio; + width *= ratio; } const x = (canvas.width / 2) - (width / 2); const y = 44 + ((402 / 2) - (height / 2));