]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Fix bug in adding a component before a nozzle 90/3990/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Thu, 12 Mar 2020 13:45:54 +0000 (15:45 +0200)
committerReino Ruusu <reino.ruusu@semantum.fi>
Thu, 12 Mar 2020 13:45:54 +0000 (15:45 +0200)
gitlab #108

Change-Id: Ie5a95734baf5ba573d3ee0a0b345a6583abee924

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));