summaryrefslogtreecommitdiff
path: root/lib/commands.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-03-16 21:23:35 +0100
committerGitHub <noreply@github.com>2025-03-16 21:23:35 +0100
commit9127a64ad54796731f384c7d9a65266f7b018738 (patch)
treef09ad4eb30ca2ce886d9023294c3feae89203b97 /lib/commands.py
parent7573798fe09f6d14c44516582d3fdf0b4c38e5fb (diff)
fix command position index error (#3585)
Diffstat (limited to 'lib/commands.py')
-rw-r--r--lib/commands.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/commands.py b/lib/commands.py
index 3058c740..13439e80 100644
--- a/lib/commands.py
+++ b/lib/commands.py
@@ -370,7 +370,8 @@ def add_connector(document, symbol, command, element):
start_pos = (symbol.get('x'), symbol.get('y'))
centroid_pos = element.node.bounding_box(inkex.Transform(get_node_transform(element.node.getparent()))).center
connector_line = shgeo.LineString([start_pos, centroid_pos])
- if connector_line.intersects(element.shape):
+ intersection = connector_line.intersection(element.shape)
+ if not intersection.is_empty:
end_pos = get_coordinates(connector_line.intersection(element.shape))[0]
else:
# Sometimes the line won't intersect anything and will go straight to the centroid.