gradient fill for path gets lost
Opened this issue · 0 comments
Thanks for this excellent library. One issue I found is when
I have a gradient fill on a path element as it gets set as fill="none" in the svg. It works ok for a rect element.
t = paper.path("M 10 10 l 100 0 l 0 100 l -100 0 z");
t.attr({
fill: '90-#FF6c7a-#64a0c1'
});
give this svg
<path transform="matrix(1,0,0,1,0,0)" fill="none" stroke="#000" d="M10,10L110,10L110,110L10,110Z" gradient="90-#FF6c7a-#64a0c1"></path>
- see the fill="none", and a resulting view in a browser is empty.
where as for a rect some defs for the linear gradient are created and looks fine viewed in the browser:
var myrect = paper.rect(360,20,100,100);
myrect.attr({
fill: '90-#FF6c7a-#64a0c1'
});
gives
<defs> <linearGradient id="lineargradient86z4n" x1="0" y1="1" x2="6.123233995736766e-17" y2="0"><stop stop-color="#ff6c7a" offset="0%"/><stop stop-color="#64a0c1" offset="100%"/> </linearGradient></defs><rect transform="matrix(1,0,0,1,0,0)" x="360" y="20" width="100" height="100" rx="0" ry="0" stroke="#000" fill="url(#lineargradient86z4n)"></rect>
give