summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2024-07-14 08:34:40 +0200
committerGitHub <noreply@github.com>2024-07-14 08:34:40 +0200
commit2ad75356ddeeaa6d87c10289479e90d50f4a378b (patch)
treefcf7d23ae267c6fe1a6b6e488da7a8b31d8060f2
parent287249578f8b3e5dd3808ce71ce71e8d20789b36 (diff)
redwork: fix starting_point issue (#3082)
-rw-r--r--lib/extensions/redwork.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/extensions/redwork.py b/lib/extensions/redwork.py
index 7f4492de..916787da 100644
--- a/lib/extensions/redwork.py
+++ b/lib/extensions/redwork.py
@@ -69,8 +69,13 @@ class Redwork(InkstitchExtension):
for line in multi_line_string.geoms:
if line.distance(starting_point) < 2 and not start_applied:
project = line.project(starting_point, True)
- new_lines.append(substring(line, 0, project, True))
- new_lines = [substring(line, project, 1, True)] + new_lines
+ if project == 1:
+ new_lines = [line.reverse()] + new_lines
+ elif project == 0:
+ new_lines = [line] + new_lines
+ else:
+ new_lines.append(substring(line, 0, project, True))
+ new_lines = [substring(line, project, 1, True)] + new_lines
start_applied = True
else:
new_lines.append(line)