]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Fix error in PipingRules.updateFixedLengths 93/3893/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Thu, 20 Feb 2020 15:44:02 +0000 (17:44 +0200)
committerReino Ruusu <reino.ruusu@semantum.fi>
Thu, 20 Feb 2020 15:44:11 +0000 (17:44 +0200)
gitlab #86

Change-Id: I21e90ec653096797aa0f011f687baafabb6621d3

org.simantics.plant3d/src/org/simantics/plant3d/scenegraph/controlpoint/PipingRules.java

index f21047f1674d1d20ebfa9db9901d593cb6a08d5e..cb8200725df456eeca3ab738089148ed42f7cd4a 100644 (file)
@@ -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);