Skip to content

Commit

Permalink
fix(diagram): Fix oblique snapping with straight edges
Browse files Browse the repository at this point in the history
  • Loading branch information
huyenngn authored and Wuestengecko committed Sep 17, 2024
1 parent af2aa1a commit 90e2b8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion capellambse/aird/_edge_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,14 @@ def snap_oblique(
)
delta = (points[i] - source).angleto(new_point - source)
if abs(delta) >= 1:
if len(points) >= 3:
next_point = points[next_i - i + next_i]
else:
next_point = source
new_point = target.vector_snap(
source,
style=diagram.RoutingStyle.OBLIQUE,
source=points[next_i - i + next_i],
source=next_point,
)
points[i] = new_point

Expand Down

0 comments on commit 90e2b8d

Please sign in to comment.