Ensure select-up/down-stream action follows branches in flows

This commit is contained in:
Nick O'Leary
2021-03-03 14:20:55 +00:00
parent b5751e5746
commit 15715a2968
4 changed files with 12 additions and 10 deletions

View File

@@ -26,9 +26,9 @@ RED.view.tools = (function() {
if (type === 'all') {
connected = RED.nodes.getAllFlowNodes(n);
} else if (type === 'up') {
connected = RED.nodes.getAllUpstreamNodes(n);
connected = [n].concat(RED.nodes.getAllUpstreamNodes(n));
} else if (type === 'down') {
connected = RED.nodes.getAllDownstreamNodes(n);
connected = [n].concat(RED.nodes.getAllDownstreamNodes(n));
}
connected.forEach(function(nn) { visited.add(nn) })
}

View File

@@ -3087,9 +3087,9 @@ RED.view = (function() {
var targetEdgeDelta = mousedown_node.w > 30 ? 25 : 8;
if (edgeDelta < targetEdgeDelta) {
if (clickPosition < 0) {
cnodes = RED.nodes.getAllUpstreamNodes(mousedown_node);
cnodes = [mousedown_node].concat(RED.nodes.getAllUpstreamNodes(mousedown_node));
} else {
cnodes = RED.nodes.getAllDownstreamNodes(mousedown_node);
cnodes = [mousedown_node].concat(RED.nodes.getAllDownstreamNodes(mousedown_node));
}
} else {
cnodes = RED.nodes.getAllFlowNodes(mousedown_node);