From: Reino Ruusu Date: Thu, 12 Mar 2020 13:45:54 +0000 (+0200) Subject: Fix bug in adding a component before a nozzle X-Git-Tag: v1.43.0~35 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F90%2F3990%2F1;p=simantics%2F3d.git Fix bug in adding a component before a nozzle gitlab #108 Change-Id: Ie5a95734baf5ba573d3ee0a0b345a6583abee924 --- 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));