diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2022-04-24 08:27:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-24 08:27:42 +0200 |
| commit | f9d57f6ea51ea8da186c41b70950b7d87fa2c20b (patch) | |
| tree | 7c2664fc201933b64cc224adb28ff717e6f08c61 /lib/extensions/remove_embroidery_settings.py | |
| parent | 4058712139b56a2419e01db700581b3c9554a88a (diff) | |
Fix lettering scale, etc. (#1620)
* fix lettering scale
* adapt to updated inkex: transform operator, selections
* fix #1597
* no traceback error message on broken satin columns
* highlight troubleshoot "steps to solve" through additional headline
* set a minimum value for running stitch repeats
* rename "import" thread list to "apply" thread list
Diffstat (limited to 'lib/extensions/remove_embroidery_settings.py')
| -rw-r--r-- | lib/extensions/remove_embroidery_settings.py | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/extensions/remove_embroidery_settings.py b/lib/extensions/remove_embroidery_settings.py index 31c15cd9..d8e6cb0e 100644 --- a/lib/extensions/remove_embroidery_settings.py +++ b/lib/extensions/remove_embroidery_settings.py @@ -3,11 +3,10 @@ # Copyright (c) 2010 Authors # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. -from inkex import NSS, Boolean +from inkex import NSS, Boolean, ShapeElement from ..commands import find_commands from ..svg.svg import find_elements -from ..svg.tags import EMBROIDERABLE_TAGS, SVG_GROUP_TAG from .base import InkstitchExtension @@ -36,7 +35,7 @@ class RemoveEmbroiderySettings(InkstitchExtension): self.remove_element(print_setting) def remove_params(self): - if not self.svg.selected: + if not self.svg.selection: xpath = ".//svg:path|.//svg:circle|.//svg:rect|.//svg:ellipse" elements = find_elements(self.svg, xpath) self.remove_inkstitch_attributes(elements) @@ -45,7 +44,7 @@ class RemoveEmbroiderySettings(InkstitchExtension): self.remove_inkstitch_attributes(elements) def remove_commands(self): - if not self.svg.selected: + if not self.svg.selection: # remove intact command groups xpath = ".//svg:g[starts-with(@id,'command_group')]" groups = find_elements(self.svg, xpath) @@ -58,7 +57,7 @@ class RemoveEmbroiderySettings(InkstitchExtension): group = command.connector.getparent() group.getparent().remove(group) - if not self.svg.selected: + if not self.svg.selection: # remove standalone commands and ungrouped object commands standalone_commands = ".//svg:use[starts-with(@xlink:href, '#inkstitch_')]|.//svg:path[starts-with(@id, 'command_connector')]" self.remove_elements(standalone_commands) @@ -68,14 +67,7 @@ class RemoveEmbroiderySettings(InkstitchExtension): self.remove_elements(symbols) def get_selected_elements(self): - elements = [] - for node in self.svg.selected.values(): - if node.tag == SVG_GROUP_TAG: - for child in node.iterdescendants(EMBROIDERABLE_TAGS): - elements.append(child) - else: - elements.append(node) - return elements + return self.svg.selection.get(ShapeElement) def remove_elements(self, xpath): elements = find_elements(self.svg, xpath) |
