Fix deleting node in group after changing selection

This commit is contained in:
Nick O'Leary 2020-06-16 10:54:50 +01:00
parent 56efd51c06
commit aebb7da3c7
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 5 additions and 3 deletions

View File

@ -2824,7 +2824,7 @@ RED.view = (function() {
if (!d3.event.ctrlKey && !d3.event.metaKey) {
// Ctrl not pressed so clear selection
deselectGroup(nodeGroup);
selectGroup(nodeGroup,false);
selectGroup(nodeGroup,false,false);
}
// Select this node
mousedown_node.selected = true;
@ -3154,12 +3154,14 @@ RED.view = (function() {
d3.event.stopPropagation();
}
function selectGroup(g, includeNodes) {
function selectGroup(g, includeNodes, addToMovingSet) {
if (!g.selected) {
g.selected = true;
g.dirty = true;
}
moving_set.push({n:g});
if (addToMovingSet !== false) {
moving_set.push({n:g});
}
if (includeNodes) {
var currentSet = new Set(moving_set.map(function(n) { return n.n }));
var allNodes = RED.group.getNodes(g,true);