Skip to content
Snippets Groups Projects
Commit c87240ca authored by Klaus Becker's avatar Klaus Becker
Browse files

solved bug

refs 406
parent 4ededccc
No related branches found
No related tags found
No related merge requests found
...@@ -43,6 +43,6 @@ public class CreateCommand extends CommandBase { ...@@ -43,6 +43,6 @@ public class CreateCommand extends CommandBase {
@Override @Override
public void execute() { public void execute() {
doLayout(); doLayout();
addConnectionPoint(connection, location.x, location.y); addConnectionPoint(connection, index, location.x, location.y);
} }
} }
...@@ -243,13 +243,13 @@ public class LayoutDataUtils { ...@@ -243,13 +243,13 @@ public class LayoutDataUtils {
} }
/** Adds the given x/y point to the layout data of the given element. */ /** Adds the given x/y point to the layout data of the given element. */
public static void addConnectionPoint(ILayoutedModelElement lobject, int x, public static void addConnectionPoint(ILayoutedModelElement lobject,
int y) { int index, int x, int y) {
Points pts = getConnectionPoints(lobject); Points existingPoints = getConnectionPoints(lobject);
Point np = LayoutModelElementFactory.createPoint(x, y, null); Point newPoint = LayoutModelElementFactory.createPoint(x, y, null);
pts.getPointsList().add(np); existingPoints.getPointsList().add(index, newPoint);
PointsUtils.setPoints(lobject, LayoutKeyConstants.CONNECTION_POINTS, PointsUtils.setPoints(lobject, LayoutKeyConstants.CONNECTION_POINTS,
pts); existingPoints);
} }
/** Changes the point of the layout data at the given index. */ /** Changes the point of the layout data at the given index. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment