]> gerrit.simantics Code Review - simantics/3d.git/blobdiff - org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java
Fix bug in adding a component before a nozzle
[simantics/3d.git] / org.simantics.plant3d / src / org / simantics / plant3d / utils / ComponentUtils.java
index 438e0bd6a96eae87cf8121640a11bfd350409161..a1ac7f82834a5a36551e93bebd42b7aa8e9fa45c 100644 (file)
@@ -447,6 +447,8 @@ public class ComponentUtils {
 
                } else if (toPcp.isDirected()) {
                        dir = new Vector3d(toPcp.getDirection(Direction.NEXT));
+                       if (position == PositionType.PREVIOUS)
+                               dir.negate();
                        pos = new Vector3d(toPcp.getWorldPosition());
                } else if (toPcp.isTurn() && toPcp.asFixedAngle()) {
                        dir = new Vector3d(toPcp.getDirection(position == PositionType.NEXT ? Direction.NEXT : Direction.PREVIOUS));