* Bug #13064 fixed - Deleting a link connected to a split lead to a translated 83/13383/2
Clément DAVID [Thu, 19 Dec 2013 11:17:28 +0000 (12:17 +0100)]
                     link.

Change-Id: I180bfd7740b5c13d79a679ddf9f7a651cd78c499

scilab/CHANGES_5.5.X
scilab/modules/xcos/src/java/org/scilab/modules/xcos/graph/XcosDiagram.java

index e50703b..e6fd176 100644 (file)
@@ -283,6 +283,9 @@ Scilab Bug Fixes
 
 * Bug #13063 fixed - Color selection in SciNotes preferences threw exceptions.
 
+* Bug #13064 fixed - Deleting a link connected to a split lead to a translated
+                     link.
+
 * Bug #13069 fixed - Documentation for %MODELICA_USER_LIBS updated.
 
 * Bug #13066 fixed - data_bounds was not fully documented in axes_properties.
index d25780f..4689566 100644 (file)
@@ -1144,6 +1144,11 @@ public class XcosDiagram extends ScilabGraph {
         final Object newLink1 = createEdge(null, null, null, src, trg, null);
         addCell(newLink1, null, null, src, trg);
         geometry = getModel().getGeometry(newLink1);
+        if (getModel().getParent(newLink1) instanceof BasicBlock) {
+            // on a loop link, translate the points as the cell has been moved to the parent
+            orig.setX(orig.getX() + geometry.getX());
+            orig.setY(orig.getY() + geometry.getY());
+        }
         geometry.setPoints(points);
         getModel().setGeometry(newLink1, geometry);