diff options
Diffstat (limited to 'lib/stitches')
| -rw-r--r-- | lib/stitches/auto_satin.py | 2 | ||||
| -rw-r--r-- | lib/stitches/utils/autoroute.py | 13 |
2 files changed, 5 insertions, 10 deletions
diff --git a/lib/stitches/auto_satin.py b/lib/stitches/auto_satin.py index 1495891e..cca65d1b 100644 --- a/lib/stitches/auto_satin.py +++ b/lib/stitches/auto_satin.py @@ -624,7 +624,7 @@ def add_trims(elements, trim_indices): just_trimmed = False for i, element in enumerate(elements): if just_trimmed and isinstance(element, Stroke): - element.node.getparent().remove(element.node) + element.node.delete() continue if i in trim_indices: diff --git a/lib/stitches/utils/autoroute.py b/lib/stitches/utils/autoroute.py index 0ae6bd7c..409dec36 100644 --- a/lib/stitches/utils/autoroute.py +++ b/lib/stitches/utils/autoroute.py @@ -246,17 +246,12 @@ def remove_original_elements(elements, commands_only=False): for command in element.commands: command_group = command.use.getparent() if command_group is not None and command_group.get('id').startswith('command_group'): - remove_from_parent(command_group) + command_group.delete() else: - remove_from_parent(command.connector) - remove_from_parent(command.use) + command.connector.delete() + command.use.delete() if not commands_only: - remove_from_parent(element.node) - - -def remove_from_parent(node): - if node.getparent() is not None: - node.getparent().remove(node) + element.node.delete() def create_new_group(parent, insert_index, label, correction_transform=True): |
