fix exporting lines as svg (#836)

This commit is contained in:
David Luzar 2020-02-24 18:30:21 +01:00 committed by GitHub
parent 19e746792e
commit 4977593ec4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -315,21 +315,7 @@ export function renderElementToSvg(
case "rectangle":
case "diamond":
case "ellipse":
case "line": {
generateElement(element, generator);
const node = rsvg.draw(element.shape as Drawable);
const opacity = element.opacity / 100;
if (opacity !== 1) {
node.setAttribute("stroke-opacity", `${opacity}`);
node.setAttribute("fill-opacity", `${opacity}`);
}
node.setAttribute(
"transform",
`translate(${offsetX || 0} ${offsetY || 0})`,
);
svgRoot.appendChild(node);
break;
}
case "line":
case "arrow": {
generateElement(element, generator);
const group = svgRoot.ownerDocument!.createElementNS(SVG_NS, "g");