summaryrefslogtreecommitdiff
path: root/lib/extensions
diff options
context:
space:
mode:
authorClaudine Peyrat <88194877+claudinepeyrat06@users.noreply.github.com>2024-03-23 23:26:41 +0100
committerGitHub <noreply@github.com>2024-03-23 23:26:41 +0100
commitc59449d634678683f3ba35d5381f5e7eaa7f978d (patch)
tree9b04ef269ec8a9b100a2a6555a00e7bf38f3817e /lib/extensions
parent1112959da18dad9a1a7790905cd57e4ed5903a8b (diff)
Update jump_to_stroke.py (#2795)
Diffstat (limited to 'lib/extensions')
-rw-r--r--lib/extensions/jump_to_stroke.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/extensions/jump_to_stroke.py b/lib/extensions/jump_to_stroke.py
index 121af885..c4f07325 100644
--- a/lib/extensions/jump_to_stroke.py
+++ b/lib/extensions/jump_to_stroke.py
@@ -47,8 +47,10 @@ class JumpToStroke(InkstitchExtension):
for element in self.elements:
layer, group = self._get_element_layer_and_group(element)
stitch_groups = element.to_stitch_groups(last_stitch_group)
+ multiple = not self.options.merge_subpaths and stitch_groups
- if not self.options.merge_subpaths and stitch_groups:
+ if multiple:
+ ending_point = stitch_groups[0].stitches[0]
stitch_groups = [stitch_groups[-1]]
if (not stitch_groups or
@@ -71,9 +73,11 @@ class JumpToStroke(InkstitchExtension):
last_group = group
last_stitch_group = stitch_group
continue
-
start = last_stitch_group.stitches[-1]
- end = stitch_group.stitches[0]
+ if multiple:
+ end = ending_point
+ else:
+ end = stitch_group.stitches[0]
self.generate_stroke(last_element, element, start, end)
last_stitch_group = stitch_group
@@ -107,7 +111,6 @@ class JumpToStroke(InkstitchExtension):
parent = node.getparent()
index = parent.index(node)
paths = node.get_path().break_apart()
- paths.reverse()
block_ids = []
for path in paths: