From: Reino Ruusu Date: Thu, 20 Feb 2020 15:44:02 +0000 (+0200) Subject: Fix error in PipingRules.updateFixedLengths X-Git-Tag: v1.43.0~68 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F93%2F3893%2F1;p=simantics%2F3d.git Fix error in PipingRules.updateFixedLengths gitlab #86 Change-Id: I21e90ec653096797aa0f011f687baafabb6621d3 --- diff --git a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java index f21047f1..cb820072 100644 --- a/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java +++ b/org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java @@ -781,9 +781,9 @@ public class PipingRules { if (curr < -MIN_INLINE_LENGTH && prev != null && prev.gap == Gap.SPACE) { double move = Math.min(-curr, prev.d); curr+= move; - next.d -= move; - if (next.d < MIN_INLINE_LENGTH) - next.gap = Gap.ATTACHED; + prev.d -= move; + if (prev.d < MIN_INLINE_LENGTH) + prev.gap = Gap.ATTACHED; Vector3d mv = new Vector3d(dir); mv.normalize(); mv.scale(-move);