only process each node once

pull/224/head
Lex Neva 2018-07-04 23:00:03 -04:00
rodzic 7ccc6aa72c
commit 1b63ac5bfa
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -142,5 +142,11 @@ class Commands(InkstitchExtension):
for command in commands: for command in commands:
self.ensure_symbol(command) self.ensure_symbol(command)
# Each object (node) in the SVG may correspond to multiple Elements of different
# types (e.g. stroke + fill). We only want to process each one once.
seen_nodes = set()
for element in self.elements: for element in self.elements:
if element.node not in seen_nodes:
self.add_command(element, commands) self.add_command(element, commands)
seen_nodes.add(element.node)