Literally Canvas创造了'Line'制动svg导出

时间:2017-12-21 18:19:56

标签: javascript canvas svg

Createshape'Line'正在制作我从Literally Canvas导出的svg。如果我注释掉下面的createshape'Line'它可以工作 - 取消注释它并且svg有错误。谁知道问题可能是什么?

sendTransaction()

1 个答案:

答案 0 :(得分:0)

发现了这个问题。 defineSVGRenderer('Line')中存在错误:

return "<g> <line x1='" + x1 + "' y1='" + y1 + "' x2='" + x2 + "' y2='" + y2 + "' " + dashString + " stroke-linecap='" + shape.capStyle + "' stroke='" + shape.color + " 'stroke-width='" + shape.strokeWidth + "' /> " + capString + " </g>";

应该是:

return "<g> <line x1='" + x1 + "' y1='" + y1 + "' x2='" + x2 + "' y2='" + y2 + "' " + dashString + " stroke-linecap='" + shape.capStyle + "' stroke='" + shape.color + "' stroke-width='" + shape.strokeWidth + "' /> " + capString + " </g>";

提示:在shape.color之后直接使用单个逗号。