Mark nodes as changed when they are moved

This commit is contained in:
Nick O'Leary 2016-10-05 10:59:52 +01:00
parent d658fe7709
commit c60e0d389c
2 changed files with 8 additions and 2 deletions

View File

@ -176,6 +176,7 @@ RED.history = (function() {
n.n.x = n.ox; n.n.x = n.ox;
n.n.y = n.oy; n.n.y = n.oy;
n.n.dirty = true; n.n.dirty = true;
n.n.changed = n.changed;
} }
// A move could have caused a link splice // A move could have caused a link splice
if (ev.links) { if (ev.links) {

View File

@ -806,7 +806,9 @@ RED.view = (function() {
if (moving_set.length > 0) { if (moving_set.length > 0) {
var ns = []; var ns = [];
for (var j=0;j<moving_set.length;j++) { for (var j=0;j<moving_set.length;j++) {
ns.push({n:moving_set[j].n,ox:moving_set[j].ox,oy:moving_set[j].oy}); ns.push({n:moving_set[j].n,ox:moving_set[j].ox,oy:moving_set[j].oy,changed:moving_set[j].n.changed});
moving_set[j].n.dirty = true;
moving_set[j].n.changed = true;
} }
historyEvent = {t:"move",nodes:ns,dirty:RED.nodes.dirty()}; historyEvent = {t:"move",nodes:ns,dirty:RED.nodes.dirty()};
if (activeSpliceLink) { if (activeSpliceLink) {
@ -987,10 +989,13 @@ RED.view = (function() {
if (moving_set.length > 0) { if (moving_set.length > 0) {
var ns = []; var ns = [];
for (var i=0;i<moving_set.length;i++) { for (var i=0;i<moving_set.length;i++) {
ns.push({n:moving_set[i].n,ox:moving_set[i].ox,oy:moving_set[i].oy}); ns.push({n:moving_set[i].n,ox:moving_set[i].ox,oy:moving_set[i].oy,changed:moving_set[i].n.changed});
moving_set[i].n.changed = true;
moving_set[i].n.dirty = true;
delete moving_set[i].ox; delete moving_set[i].ox;
delete moving_set[i].oy; delete moving_set[i].oy;
} }
redraw();
RED.history.push({t:"move",nodes:ns,dirty:RED.nodes.dirty()}); RED.history.push({t:"move",nodes:ns,dirty:RED.nodes.dirty()});
RED.nodes.dirty(true); RED.nodes.dirty(true);
} }