diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2024-12-26 16:19:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-26 16:19:35 +0100 |
| commit | ef7d056173cc6d7782d6120c031dae9276725a3d (patch) | |
| tree | 75d2ef67976336a93424b504e42bbf1a394b9a49 /lib/extensions/params.py | |
| parent | e20161a4ec9a69cb0f1bdfdd16bcd27a8601fde7 (diff) | |
End points (#3370)
* end at nearest point to next element (if requested and possible)
Diffstat (limited to 'lib/extensions/params.py')
| -rwxr-xr-x | lib/extensions/params.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/extensions/params.py b/lib/extensions/params.py index dd5c427c..0cac9365 100755 --- a/lib/extensions/params.py +++ b/lib/extensions/params.py @@ -563,12 +563,12 @@ class SettingsPanel(wx.Panel): try: wx.CallAfter(self._hide_warning) last_stitch_group = None - for node in nodes: + for node, next_node in zip_longest(nodes, self._get_next_nodes(nodes)): # Making a copy of the embroidery element is an easy # way to drop the cache in the @cache decorators used # for many params in embroider.py. - stitch_groups.extend(copy(node).embroider(last_stitch_group)) + stitch_groups.extend(copy(node).embroider(last_stitch_group, next_node)) if stitch_groups: last_stitch_group = stitch_groups[-1] @@ -587,6 +587,11 @@ class SettingsPanel(wx.Panel): except Exception: wx.CallAfter(self._show_warning, format_uncaught_exception()) + def _get_next_nodes(self, nodes): + if len(nodes) > 1: + return nodes[1:] + return [] + def get_stroke_last_tabs(self): tabs = self.tabs stroke_index = [tabs.index(tab) for tab in tabs if tab.name == _("Stroke")] |
