niklasvh/html2canvas — Issue #36: Possible improvement: canvasWidth & canvasHeight
Author: Tobiasartz
Created: 2011-12-01 00:18:02+00:00
State: open

Hi, I'm totally new to your great script.
But I noticed something interesting about the canvas dimensions.
When a user sets them they should be honored IMHO.
Now your using whatever is bigger: The document or the user settings.
Example:
```
$('#target').html2canvas( {
canvasHeight : 60,
canvasWidth : 400
});
```
I made the following edits in your code:
Line 63 and 64
``` canvasWidth:null,
canvasHeight:null,
```
Line 1347 and 1348
```this.canvas.width = this.opts.canvasWidth || $(document).width();
this.canvas.height = this.opts.canvasHeight || $(document).height();
```

Now the document sizes will be used if no user preference is given.

Let me know what you think of this!