Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to connect node inbetween two already connected nodes with drag and drop #78

Closed
bentoogood opened this issue Apr 2, 2013 · 1 comment
Assignees

Comments

@bentoogood
Copy link
Contributor

Dragging a node over an existing connection should highlight the connection to indicate that insertion is possible.
Dropping the node whilst the connection is highlighted would perform the insertion.

This action reduces the number of clicks involved to make the connection, and makes insertion easier where the upstream or downstream connection is off screen somewhere.

this demo does not show highlighting before connecting
drag

@ghost ghost assigned johnhaddon Apr 5, 2013
@johnhaddon
Copy link
Member

I think we can achieve this as follows :

  • During dragMove events, the GraphGadget does a selection step to find candidate connections
    • Drawing only the connections
    • Using a reasonably sized window around the cursor so you don't need to hit a connection exactly
  • Candidate connections are then tested against the node being dragged, using Plug::acceptsInput() to see if an insertion is reasonable
  • When a reasonable insertion is found, the GraphGadget stops drawing the original connection, and manually draws the proposed new connections.
  • On dragEnd, the GraphGadget hooks things up

@ghost ghost assigned andrewkaufman Apr 12, 2013
andrewkaufman added a commit to andrewkaufman/gaffer that referenced this issue Apr 16, 2013
In the Node Graph, users can drag nodes onto existing connections to see automated re-wiring suggestions. Dropping the node into the chain will perform the re-wiring (which is undoable).

Also added GraphGadget::connectionGadgetAt as a convenience for connection queries.

Fixes issue GafferHQ#78.
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

No branches or pull requests

3 participants