diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2022-05-20 12:06:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-20 12:06:31 -0400 |
| commit | 8ab4abf190778867a8eccde08733c45f3760b2d0 (patch) | |
| tree | f5b63f5e192c36d8c6bf47e4c30c68d8b1a73728 /lib/elements/clone.py | |
| parent | 1316e8132e58361f42cb4315c586e0e2cccfc64c (diff) | |
| parent | 47123198760f8740acda0799d3b22f14b3f69550 (diff) | |
Merge pull request #1548 from inkstitch/feature_guided_fill
Feature guided fill
Diffstat (limited to 'lib/elements/clone.py')
| -rw-r--r-- | lib/elements/clone.py | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/lib/elements/clone.py b/lib/elements/clone.py index f408917d..d9185012 100644 --- a/lib/elements/clone.py +++ b/lib/elements/clone.py @@ -5,19 +5,14 @@ from math import atan, degrees -from ..commands import is_command, is_command_symbol +from ..commands import is_command_symbol from ..i18n import _ from ..svg.path import get_node_transform from ..svg.svg import find_elements -from ..svg.tags import (EMBROIDERABLE_TAGS, INKSTITCH_ATTRIBS, - SVG_POLYLINE_TAG, SVG_USE_TAG, XLINK_HREF) +from ..svg.tags import (EMBROIDERABLE_TAGS, INKSTITCH_ATTRIBS, SVG_USE_TAG, + XLINK_HREF) from ..utils import cache -from .auto_fill import AutoFill from .element import EmbroideryElement, param -from .fill import Fill -from .polyline import Polyline -from .satin_column import SatinColumn -from .stroke import Stroke from .validation import ObjectTypeWarning, ValidationWarning @@ -68,28 +63,8 @@ class Clone(EmbroideryElement): return self.get_float_param('angle', 0) def clone_to_element(self, node): - # we need to determine if the source element is polyline, stroke, fill or satin - element = EmbroideryElement(node) - - if node.tag == SVG_POLYLINE_TAG: - return [Polyline(node)] - - elif element.get_boolean_param("satin_column") and self.get_clone_style("stroke", self.node): - return [SatinColumn(node)] - else: - elements = [] - if element.get_style("fill", "black") and not element.get_style("stroke", 1) == "0": - if element.get_boolean_param("auto_fill", True): - elements.append(AutoFill(node)) - else: - elements.append(Fill(node)) - if element.get_style("stroke", self.node) is not None: - if not is_command(element.node): - elements.append(Stroke(node)) - if element.get_boolean_param("stroke_first", False): - elements.reverse() - - return elements + from .utils import node_to_elements + return node_to_elements(node, True) def to_stitch_groups(self, last_patch=None): patches = [] |
