Reputation: 22949
i am doing a modification of svg-editor, specifically a mod of the method-draw implementation.
I am trying to create a function that if called automatically selects all objects and changes their stroke color.
i am able to call within my function this:
svgCanvas.selectAllInCurrentLayer();
which basically selects all items on canvas. However when i type below it the change stroke color function
svgCanvas.setcolor("stroke", "red");
it doesnt run the second command(the stroke change function).
Upvotes: 0
Views: 219
Reputation: 72405
In Method Draw/SVG Edit you would do:
svgCanvas.selectAllInCurrentLayer();
var selected = svgCanvas.getSelectedElems();
selected.forEach(function(el){
el.setAttribute("stroke", "red")
});
Upvotes: 1