Createshape'Line'正在制作我从Literally Canvas导出的svg。如果我注释掉下面的createshape'Line'它可以工作 - 取消注释它并且svg有错误。谁知道问题可能是什么?
sendTransaction()
答案 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之后直接使用单个逗号。