diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2021-07-25 07:24:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-25 07:24:34 +0200 |
| commit | 2f35a4a192eb6aa3b68b715da6c1ba984084e0e5 (patch) | |
| tree | 7a28d41ff83730e3bf53ee65b315783497503cec /lib/stitches/auto_satin.py | |
| parent | 36815f977d7236311e9b345c33fbc74390766385 (diff) | |
Fix Style Issues (#1154)
Co-authored-by: Lex Neva <github.com@lexneva.name>
Diffstat (limited to 'lib/stitches/auto_satin.py')
| -rw-r--r-- | lib/stitches/auto_satin.py | 15 |
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) }) |
