]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/actions/TranslateInlineAction.java
Get inline component direction irrespectively of connectivity
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / actions / TranslateInlineAction.java
index 3aac1fd99b005f50473c46c7ee0d025360900023..91cc3ceae233e2c68f2f300ed2a612f158ba5620 100644 (file)
@@ -43,7 +43,7 @@ public class TranslateInlineAction extends TranslateAction{
                        } else if (comp.getNext() == null || comp.getPrevious() == null) {
                 setEnabled(true);
                 inline = false;
-                dir = comp.getControlPoint().getPathLegDirection(Direction.NEXT);
+                dir = comp.getControlPoint().getInlineDir();
                 dir.normalize();
             } else {
                                setEnabled(true);
@@ -66,8 +66,7 @@ public class TranslateInlineAction extends TranslateAction{
                                Point3d pe = new Point3d();
                                next.getEnds(ns, ne);
                                prev.getEnds(ps, pe);
-                               dir = comp.getControlPoint().getPathLegDirection(Direction.NEXT);
-                               dir.normalize();
+                               dir = comp.getControlPoint().getInlineDir();
                                // We may have offsets in the path leg, hence we have to project the coordinates.
                                Vector3d wp = node.getWorldPosition();
                                if (prev.getControlPoint().isVariableLength())