kopia lustrzana https://github.com/inkstitch/inkstitch
Update jump_to_stroke.py (#2795)
rodzic
1112959da1
commit
c59449d634
|
@ -47,8 +47,10 @@ class JumpToStroke(InkstitchExtension):
|
||||||
for element in self.elements:
|
for element in self.elements:
|
||||||
layer, group = self._get_element_layer_and_group(element)
|
layer, group = self._get_element_layer_and_group(element)
|
||||||
stitch_groups = element.to_stitch_groups(last_stitch_group)
|
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]]
|
stitch_groups = [stitch_groups[-1]]
|
||||||
|
|
||||||
if (not stitch_groups or
|
if (not stitch_groups or
|
||||||
|
@ -71,8 +73,10 @@ class JumpToStroke(InkstitchExtension):
|
||||||
last_group = group
|
last_group = group
|
||||||
last_stitch_group = stitch_group
|
last_stitch_group = stitch_group
|
||||||
continue
|
continue
|
||||||
|
|
||||||
start = last_stitch_group.stitches[-1]
|
start = last_stitch_group.stitches[-1]
|
||||||
|
if multiple:
|
||||||
|
end = ending_point
|
||||||
|
else:
|
||||||
end = stitch_group.stitches[0]
|
end = stitch_group.stitches[0]
|
||||||
self.generate_stroke(last_element, element, start, end)
|
self.generate_stroke(last_element, element, start, end)
|
||||||
last_stitch_group = stitch_group
|
last_stitch_group = stitch_group
|
||||||
|
@ -107,7 +111,6 @@ class JumpToStroke(InkstitchExtension):
|
||||||
parent = node.getparent()
|
parent = node.getparent()
|
||||||
index = parent.index(node)
|
index = parent.index(node)
|
||||||
paths = node.get_path().break_apart()
|
paths = node.get_path().break_apart()
|
||||||
paths.reverse()
|
|
||||||
|
|
||||||
block_ids = []
|
block_ids = []
|
||||||
for path in paths:
|
for path in paths:
|
||||||
|
|
Ładowanie…
Reference in New Issue