Xcos: relink on parameters update (with undo/redo) 49/20849/2
Clement DAVID [Wed, 13 Feb 2019 22:07:27 +0000 (23:07 +0100)]
As usual, using cell level API discard Model change propagation and kill
undo/redo operation.

Change-Id: Ibbab5a22a6dfc322322b4bf171243248fed73d3f

scilab/modules/xcos/src/java/org/scilab/modules/xcos/block/BasicBlock.java

index eadc672..e59f7e8 100644 (file)
@@ -441,8 +441,7 @@ public class BasicBlock extends XcosCell implements Serializable {
                     if (previous.getEdgeCount() != 0) {
                         final mxICell relinked = previous.getEdgeAt(0);
                         final boolean isOutgoing = previous == relinked.getTerminal(true);
-                        previous.removeEdge(relinked, isOutgoing);
-                        modified.insertEdge(relinked, isOutgoing);
+                        parent.getModel().setTerminal(relinked, modified, isOutgoing);
                     }
 
                     parent.removeCells(new Object[] { previous }, false);