summaryrefslogtreecommitdiff
path: root/lib/stitches
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stitches')
-rw-r--r--lib/stitches/auto_satin.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/stitches/auto_satin.py b/lib/stitches/auto_satin.py
index a047ea74..2b7f0906 100644
--- a/lib/stitches/auto_satin.py
+++ b/lib/stitches/auto_satin.py
@@ -8,7 +8,6 @@ from itertools import chain
import inkex
import networkx as nx
-from lxml import etree
from shapely import geometry as shgeo
from shapely.geometry import Point as ShapelyPoint
@@ -17,8 +16,7 @@ from ..elements import SatinColumn, Stroke
from ..i18n import _
from ..svg import (PIXELS_PER_MM, generate_unique_id, get_correction_transform,
line_strings_to_csp)
-from ..svg.tags import (INKSCAPE_LABEL, INKSTITCH_ATTRIBS, SVG_GROUP_TAG,
- SVG_PATH_TAG)
+from ..svg.tags import (INKSCAPE_LABEL, INKSTITCH_ATTRIBS)
from ..utils import Point as InkstitchPoint
from ..utils import cache, cut
@@ -219,14 +217,13 @@ class RunningStitch(object):
original_element.node.get(INKSTITCH_ATTRIBS['contour_underlay_stitch_length_mm'], '')
def to_element(self):
- node = etree.Element(SVG_PATH_TAG)
+ node = inkex.PathElement()
d = str(inkex.paths.CubicSuperPath(line_strings_to_csp([self.path])))
node.set("d", d)
- style = self.original_element.parse_style()
- style['stroke-dasharray'] = "0.5,0.5"
- style = str(inkex.Style(style))
- node.set("style", style)
+ dasharray = inkex.Style("stroke-dasharray:0.5,0.5;")
+ style = inkex.Style(self.original_element.node.get('style', '')) + dasharray
+ node.set("style", str(style))
node.set(INKSTITCH_ATTRIBS['running_stitch_length_mm'], self.running_stitch_length)
stroke = Stroke(node)
@@ -658,7 +655,7 @@ def preserve_original_groups(elements, original_parent_nodes):
def create_new_group(parent, insert_index):
- group = etree.Element(SVG_GROUP_TAG, {
+ group = inkex.Group(attrib={
INKSCAPE_LABEL: _("Auto-Satin"),
"transform": get_correction_transform(parent, child=True)
})