diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2025-01-16 19:21:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-16 19:21:57 +0100 |
| commit | be595f14609237dc8ab867b937b44a311028555e (patch) | |
| tree | 8137e229148e59839f6a8e0b2761a49b46eb5282 /lib/extensions/unlink_clone.py | |
| parent | 11cd0ea445af572a49566a3483cfc93033fa2239 (diff) | |
improve symbol handling (#3440)
Diffstat (limited to 'lib/extensions/unlink_clone.py')
| -rw-r--r-- | lib/extensions/unlink_clone.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/extensions/unlink_clone.py b/lib/extensions/unlink_clone.py index e94bf0ea..bebfbdb8 100644 --- a/lib/extensions/unlink_clone.py +++ b/lib/extensions/unlink_clone.py @@ -3,14 +3,14 @@ # Copyright (c) 2010 Authors # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. -from inkex import Boolean, errormsg, BaseElement +from typing import List, Tuple + +from inkex import BaseElement, Boolean, Group, errormsg from ..elements import Clone, EmbroideryElement from ..i18n import _ +from ..svg.tags import CONNECTION_END, CONNECTION_START, SVG_SYMBOL_TAG from .base import InkstitchExtension -from ..svg.tags import CONNECTION_END, CONNECTION_START - -from typing import List, Tuple class UnlinkClone(InkstitchExtension): @@ -35,6 +35,11 @@ class UnlinkClone(InkstitchExtension): for element in self.elements: if isinstance(element, Clone): resolved = element.resolve_clone(recursive=recursive) + if resolved[0].tag in SVG_SYMBOL_TAG: + group = Group() + for child in resolved[0]: + group.append(child) + resolved[0].getparent().replace(resolved[0], group) clones_resolved.append((element.node, resolved[0])) for (clone, resolved) in clones_resolved: |
