From 2ca4b88702d1733b86d052933e3b1e39d6c78dc6 Mon Sep 17 00:00:00 2001 From: Keith Hoffmann Date: Fri, 14 Oct 2011 00:47:17 -0500 Subject: [PATCH] Fixed a width/height issue that caused smaller elements to render full body width. --- src/Renderer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Renderer.js b/src/Renderer.js index 2380fbb..5b84bbf 100644 --- a/src/Renderer.js +++ b/src/Renderer.js @@ -2,8 +2,8 @@ html2canvas.Renderer = function(parseQueue, opts){ var options = { - "width": 0, - "height": 0, + "width": null, + "height": null, "renderer": "canvas" }, queue = [], @@ -73,8 +73,8 @@ html2canvas.Renderer = function(parseQueue, opts){ storageLen, renderItem; - canvas.width = Math.max(zStack.ctx.width, options.width); - canvas.height = Math.max(zStack.ctx.height, options.height); + canvas.width = options.width || zStack.ctx.width; + canvas.height = options.height || zStack.ctx.height; for (i = 0, queueLen = queue.length; i < queueLen; i+=1){