You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Navigation.tryToConnectNodes takes in two nodes: a moving node and a stationary one. Those nodes may map to any valid ASTNode location.
What should happen when trying to connect nodes of various types?
Impossible moving nodes
If the moving node is anything other than a block, connection, or comment, it's not allowed to move. Error, because entering this function is a bad state.
Connection to connection
Call ConnectionChecker.canConnect(first, second, false) to make sure the connection is legal.
If legal, connect.
If illegal, warn and put the moving connection's block back where it came from.
Set the cursor position to the moving node.
Block to workspace
If the moving block was previously connected, disconnect it.
Move the block to the workspace at the location specified by the workspace node.
Block to connection
Check if any connection on the moving block is compatible with the stationary connection.
If yes, disconnect the moving block from its parent (if necessary) and connect it to the stationary connection.
If no, warn and put the moving block back where it came from.
Set the cursor position to the moving block.
Block to block
???
The text was updated successfully, but these errors were encountered:
Navigation.tryToConnectNodes
takes in two nodes: a moving node and a stationary one. Those nodes may map to any validASTNode
location.What should happen when trying to connect nodes of various types?
Impossible moving nodes
If the moving node is anything other than a block, connection, or comment, it's not allowed to move. Error, because entering this function is a bad state.
Connection to connection
Call
ConnectionChecker.canConnect(first, second, false)
to make sure the connection is legal.If legal, connect.
If illegal, warn and put the moving connection's block back where it came from.
Set the cursor position to the moving node.
Block to workspace
If the moving block was previously connected, disconnect it.
Move the block to the workspace at the location specified by the workspace node.
Block to connection
Check if any connection on the moving block is compatible with the stationary connection.
If yes, disconnect the moving block from its parent (if necessary) and connect it to the stationary connection.
If no, warn and put the moving block back where it came from.
Set the cursor position to the moving block.
Block to block
???
The text was updated successfully, but these errors were encountered: