X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=org.simantics.plant3d%2Fsrc%2Forg%2Fsimantics%2Fplant3d%2Factions%2FAddComponentAction.java;h=4c116c1f26efb73d9453e850e299a43cb89992f9;hb=9e1e51825bfdcd72d7006e1bff703e7eb52919c6;hp=bf220dd8776dc03959acc6a1410e78771a4adac1;hpb=a460e609147d064dd3da464bcf1626845e0f93b4;p=simantics%2F3d.git diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java b/org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java index bf220dd8..4c116c1f 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/actions/AddComponentAction.java @@ -159,11 +159,7 @@ public class AddComponentAction extends vtkAction { PipeControlPoint newPcp = newComponent.getControlPoint(); PipeControlPoint toPcp = component.getControlPoint(); - Vector3d start = new Vector3d(); - Vector3d end = new Vector3d(); - Vector3d dir = new Vector3d(); - toPcp.getInlineControlPointEnds(start, end, dir); - dir.normalize(); + switch (position) { case NEXT: @@ -175,6 +171,13 @@ public class AddComponentAction extends vtkAction { if (toPcp.isDualSub()) toPcp = toPcp.parent; } + + Vector3d start = new Vector3d(); + Vector3d end = new Vector3d(); + Vector3d dir = new Vector3d(); + toPcp.getInlineControlPointEnds(start, end, dir); + dir.normalize(); + PipeRun pipeRun = toPcp.getPipeRun(); if (!toAdd.isSizeChange()) {