From 7d18a2e60d58572555c4cbcaa39e5f77deb4b506 Mon Sep 17 00:00:00 2001 From: CBenni Date: Mon, 11 Dec 2017 17:00:03 +0100 Subject: [PATCH] Fixed size adjustment --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index cab816f..5f25cf7 100644 --- a/index.js +++ b/index.js @@ -69,11 +69,11 @@ function render(template, img, size) { imageOffsetY = -templateOffsetY; templateOffsetY = 0; } - if(template.image.width * templateScale > resultingWidth) { - resultingWidth = template.image.width * templateScale; + if(templateOffsetX + template.image.width * templateScale > resultingWidth) { + resultingWidth = templateOffsetX + template.image.width * templateScale; } - if(template.image.height * templateScale > resultingHeight) { - resultingHeight = template.image.height * templateScale; + if(templateOffsetY + template.image.height * templateScale > resultingHeight) { + resultingHeight = templateOffsetY + template.image.height * templateScale; } const toDraw = [{