Thursday, 3 October 2013

fabric.js color of lines of SVG

fabric.js color of lines of SVG

I use fabric.js to draw a path on a map, and I wanna to change color of
the path when cursor is not hovering over it. But it seems to ignore
"stroke" parameter of the GroupPath element that's created using SVG file.
I can change fill color, though it's just filling space in between lines
and looks horrible. How can i change color of lines themselves?
fabric.loadSVGFromURL('somesvg.svg', function(objects, options) {
options.fill = 'red'; // this works
options.stroke = 'green'; // this does not
var group = new fabric.PathGroup(objects, options);
canvas.add(group);
canvas.renderAll();
});

No comments:

Post a Comment