Skip to content

Anchor connection wires at the port dots - #43

Merged
Kinflou merged 1 commit into
masterfrom
fix/wire-anchors-at-ports
Sep 3, 2026
Merged

Anchor connection wires at the port dots#43
Kinflou merged 1 commit into
masterfrom
fix/wire-anchors-at-ports

Conversation

@Kinflou

@Kinflou Kinflou commented Sep 3, 2026

Copy link
Copy Markdown
Member

The wire between two instances was drawn box-centre → box-centre, so it ran
under the node rows and stopped nowhere near the .node-port dots it's
meant to attach to (see the report — the line floats past both ports).

portAnchor(instanceId) now returns the port dot's real centre via
getBoundingClientRect (so the top: 50%; translateY(-50%) is accounted
for), converted to the same canvas space canvasPoint produces — which is
where nodes are positioned, so the endpoints land exactly on the dots.
startConnectDrag's rubber-band line starts there too. Embed view (no
port) falls back to the row centre.

yarn test (20) and yarn build pass. No coordinate assertions in the
tests to update.

`drawWires` ran box-centre to box-centre, so the line passed under the
instance rows and never touched the `.node-port` dots it's supposed to
connect. Anchor each end at the port's real (transform-aware) rect centre,
in the same coordinate space `canvasPoint` uses — the drag-to-connect line
starts there too. Falls back to the row centre in the embed view, which
has no port.
@Kinflou
Kinflou merged commit 0deb1ef into master Sep 3, 2026
2 checks passed
@Kinflou
Kinflou deleted the fix/wire-anchors-at-ports branch September 3, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant