Skip to content

Commit

Permalink
Deals with cases 5 and 6
Browse files Browse the repository at this point in the history
  • Loading branch information
Stargazer10101 committed Jan 10, 2025
1 parent 32db4a9 commit d7744dc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions frontend/src/components/views/Graph.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,21 @@
} else {
// Both horizontal - use horizontal middle point
if (outConnectorX > inConnectorX) {
const midY = (inConnectorY + outConnectorY) / 2;
const midY = (inConnectorY + outConnectorY) / 2 + (((inConnectorY + outConnectorY) / 2) % gridSpacing);
return [
{ x: outConnectorX, y: outConnectorY },
{ x: outConnectorX + gridSpacing, y: outConnectorY },
{ x: outConnectorX + gridSpacing, y: midY },
{ x: inConnectorX - gridSpacing, y: midY },
{ x: inConnectorX - gridSpacing, y: inConnectorY },
{ x: outConnectorX + gridSpacing - 2 * lineWidth, y: outConnectorY },
{ x: outConnectorX + gridSpacing - 2 * lineWidth, y: midY },
{ x: inConnectorX - gridSpacing + lineWidth, y: midY },
{ x: inConnectorX - gridSpacing + lineWidth, y: inConnectorY },
{ x: inConnectorX, y: inConnectorY },
];
} else {
const midX = (outConnectorX + inConnectorX) / 2 + (((outConnectorX + inConnectorX) / 2) % gridSpacing);
return [
{ x: outConnectorX, y: outConnectorY },
{ x: midX - halfLineWidth, y: outConnectorY },
{ x: midX - halfLineWidth, y: inConnectorY },
{ x: midX - lineWidth, y: outConnectorY },
{ x: midX - lineWidth, y: inConnectorY },
{ x: inConnectorX, y: inConnectorY },
];
}
Expand Down

0 comments on commit d7744dc

Please sign in to comment.