Explorar el Código

Suppresses unnecessary fill-rule attribute in SVG (#1397)

fujimoto kyosuke hace 5 años
padre
commit
6abcb2d87f
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      src/renderer/renderElement.ts

+ 5 - 1
src/renderer/renderElement.ts

@@ -426,7 +426,11 @@ export function renderElementToSvg(
             offsetY || 0
           }) rotate(${degree} ${cx} ${cy})`,
         );
-        if (element.type === "line") {
+        if (
+          element.type === "line" &&
+          isPathALoop(element.points) &&
+          element.backgroundColor !== "transparent"
+        ) {
           node.setAttribute("fill-rule", "evenodd");
         }
         group.appendChild(node);