From d056bf61cf168ea88cbddf6b0aac103d5a92b053 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Wed, 12 Sep 2018 03:07:06 +0000 Subject: [PATCH] Consistent Nike Logo Size --- commands/image-edit/nike-ad.js | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/commands/image-edit/nike-ad.js b/commands/image-edit/nike-ad.js index ff12bd76..0b71c7b1 100644 --- a/commands/image-edit/nike-ad.js +++ b/commands/image-edit/nike-ad.js @@ -54,7 +54,10 @@ module.exports = class NikeAdCommand extends Command { const ctx = canvas.getContext('2d'); drawImageWithTint(ctx, data, 'black', 0, 0, data.width, data.height); greyscale(ctx, 0, 0, data.width, data.height); - ctx.drawImage(base, (data.width / 2) - (base.width / 2), data.height - base.height); + const ratio = base.width / base.height; + const width = data.width / 3; + const height = Math.round(width / ratio); + ctx.drawImage(base, (data.width / 2) - (width / 2), data.height - height, width, height); ctx.font = `${Math.round(data.height / 25)}px Noto`; ctx.fillStyle = 'white'; ctx.textAlign = 'center'; diff --git a/package.json b/package.json index 49444016..440c2a4e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "91.1.0", + "version": "91.1.1", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {