fix command position index error ()

pull/3596/head dev-build-kaalleen-batch-lettering
Kaalleen 2025-03-16 21:23:35 +01:00 zatwierdzone przez GitHub
rodzic 7573798fe0
commit 9127a64ad5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -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.