]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Fix component add with overlapping setting 16/3116/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Mon, 19 Aug 2019 11:05:00 +0000 (14:05 +0300)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Mon, 19 Aug 2019 11:05:00 +0000 (14:05 +0300)
gitlab #26

Change-Id: Ib510633edd933d0def918e0af996cb6f56986876

org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java

index 174d6f1166eac0718aa4aa814bb491b34ae67c66..119820178c8e9ff2b02275788608fe5937a12fba 100644 (file)
@@ -195,31 +195,17 @@ public class AddComponentAction extends vtkSwtAction {
                    dir = new Vector3d();
                    toPcp.getInlineControlPointEnds(start, end, dir);
                    dir.normalize();
-                   if (!insertAdjustable || insertPosition == PositionType.NEXT) {
-                   switch (position) {
-                    case NEXT:
-                        pos = new Vector3d(end);
-                        break;
-                    case PREVIOUS:
-                        pos = new Vector3d(start);
-                        break;
-                    case SPLIT:
-                        break;
-                    }
-                   } else if (insertPosition == PositionType.SPLIT) {
-                       pos = new Vector3d(toPcp.getWorldPosition());
-                   } else {
-                       switch (position) {
-                    case NEXT:
-                        pos = new Vector3d(start);
-                        break;
-                    case PREVIOUS:
-                        pos = new Vector3d(end);
-                        break;
-                    case SPLIT:
-                        break;
-                    }
-                   }
+                  switch (position) {
+                case NEXT:
+                    pos = new Vector3d(end);
+                    break;
+                case PREVIOUS:
+                    pos = new Vector3d(start);
+                    break;
+                case SPLIT:
+                    pos = new Vector3d(toPcp.getWorldPosition());
+                    break;
+                }
                   
                        } else if (toPcp.isDirected()) {
                            dir = new Vector3d(toPcp.getDirection(Direction.NEXT));