From 1180e4e22c5935827272cdea27a1abb39c056ca2 Mon Sep 17 00:00:00 2001 From: Reino Ruusu Date: Thu, 12 Mar 2020 15:45:54 +0200 Subject: [PATCH] Fix bug in adding a component before a nozzle gitlab #108 Change-Id: Ie5a95734baf5ba573d3ee0a0b345a6583abee924 --- .../src/org/simantics/plant3d/utils/ComponentUtils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java b/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java index 438e0bd6..a1ac7f82 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/utils/ComponentUtils.java @@ -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)); -- 2.47.1