Merge pull request #1151 from RG72/patch-1

Options for node-canvas
This commit is contained in:
Juriy Zaytsev 2014-02-09 11:16:59 -05:00
commit 31f3c7924c

View file

@ -137,12 +137,14 @@
* @param width Canvas width
* @param height Canvas height
* @param {Object} options to pass to FabricCanvas.
* @param {Object} options to pass to NodeCanvas.
* @return {Object} wrapped canvas instance
*/
fabric.createCanvasForNode = function(width, height, options) {
fabric.createCanvasForNode = function(width, height, options, nodeCanvasOptions) {
nodeCanvasOptions = nodeCanvasOptions || options;
var canvasEl = fabric.document.createElement('canvas'),
nodeCanvas = new Canvas(width || 600, height || 600);
nodeCanvas = new Canvas(width || 600, height || 600, nodeCanvasOptions);
// jsdom doesn't create style on canvas element, so here be temp. workaround
canvasEl.style = { };