summaryrefslogtreecommitdiff
path: root/lib/stitch_plan/stitch_plan.py
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2023-02-16 22:58:10 -0500
committerGitHub <noreply@github.com>2023-02-16 22:58:10 -0500
commit7aee0979be4f39cde7a6396cdc0d1d2cc4222d90 (patch)
tree1123050a6ba7428dbcc8b72bd074161bdb3e014f /lib/stitch_plan/stitch_plan.py
parent30c73dc39c1ac814d0c63ec102c7f8c2b993fdd0 (diff)
parentf6c2aa89197c82cedfb31465fc4b2acffaeb8f25 (diff)
Merge pull request #2045 from inkstitch/lexelby/interruptible-threads
make simulator threads interruptible
Diffstat (limited to 'lib/stitch_plan/stitch_plan.py')
-rw-r--r--lib/stitch_plan/stitch_plan.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/stitch_plan/stitch_plan.py b/lib/stitch_plan/stitch_plan.py
index 313bc6e0..741ec006 100644
--- a/lib/stitch_plan/stitch_plan.py
+++ b/lib/stitch_plan/stitch_plan.py
@@ -11,6 +11,7 @@ from ..i18n import _
from ..svg import PIXELS_PER_MM
from .color_block import ColorBlock
from .ties import add_ties
+from ..utils.threading import check_stop_flag
def stitch_groups_to_stitch_plan(stitch_groups, collapse_len=None, min_stitch_len=0.1, disable_ties=False): # noqa: C901
@@ -34,6 +35,8 @@ def stitch_groups_to_stitch_plan(stitch_groups, collapse_len=None, min_stitch_le
color_block = stitch_plan.new_color_block(color=stitch_groups[0].color)
for stitch_group in stitch_groups:
+ check_stop_flag()
+
if not stitch_group.stitches:
continue