0
패턴 캔버스에로드 및 배치되었습니다 SVG 렌더링하지 않는 것이
var src=__dirname + '/test.svg';
fabric.PathGroup.fromObject({paths:src,toBeParsed:true},function(pg) {
var patternSourceCanvas = fabric.createCanvasForNode(pg.width, pg.height);
patternSourceCanvas.add(pg);
patternSourceCanvas.renderAll();
var pcanvas= patternSourceCanvas.getElement();
//uncomment these comments,you will get something
/*var pctx = pcanvas.getContext('2d')
pctx.beginPath();
pctx.rect(0,0,10,10);
pctx.fillStyle='red';
pctx.fill();
pctx.beginPath();
pctx.rect(10,10,10,10);
pctx.fillStyle='blue';
pctx.fill();
*/
var pattern = new fabric.Pattern({
source: pcanvas,
repeat: 'repeat'
});
canvas.setBackgroundColor(pattern, function() { canvas.renderAll();
fs.writeFile(__dirname + '/text333.png', canvas.nodeCanvas.toBuffer());
});
})
을 작동하지 않는, 그래서 내가 버그 또는 무언가이다 백그라운드에서 아무것도 없어?사용 SVG는