textures icon indicating copy to clipboard operation
textures copied to clipboard

Have a new texture instance with a copy() method

Open riccardoscalco opened this issue 11 years ago • 0 comments

At the moment a new texture cannot be created from another one. The following direction has been suggest on issue #7.

var svg = d3.select("#example").append("svg");

var t1 = textures.lines().thicker();
var t2 = t1.copy().fill("red") // This creates a new texture instance

// t1 and t2 would have separate defs in the SVG
svg.call(t1);
svg.call(t2);

svg.append("circle").style("fill", t1.url());
svg.append("circle").style("fill", t2.url());

riccardoscalco avatar Mar 25 '15 09:03 riccardoscalco