Add virtual slots to Reroutes (#970)

### Virtual helper "slots"

Adds a virtual input and output slot to native reroutes, allowing links
to be dragged from them to other reroutes or nodes.


https://github.com/user-attachments/assets/67d308c4-4732-4b04-a2b9-0a2b0c79b413

### Notes

- Reroute slots automatically show an outline as the pointer gets close
- When the slot is clickable, it will highlight in the same colour as
the reroute
- Enables opposite direction connecting: from reroute to node outputs
- Floating reroutes only show one slot - to whichever side is not
connected
This commit is contained in:
filtered
2025-04-27 03:00:01 +10:00
committed by GitHub
parent de0f0ebac1
commit 5c41e4e09c
6 changed files with 399 additions and 73 deletions

View File

@@ -36,6 +36,8 @@ export enum CanvasItem {
Link = 1 << 3,
/** A resize in the bottom-right corner */
ResizeSe = 1 << 4,
/** A reroute slot */
RerouteSlot = 1 << 5,
}
/** The direction that a link point will flow towards - e.g. horizontal outputs are right by default */