]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Improved line gaps 29/4929/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Thu, 15 Dec 2022 12:11:27 +0000 (14:11 +0200)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Thu, 15 Dec 2022 12:11:27 +0000 (14:11 +0200)
Fixed multi-gap handling (stored relative coordinate for the next gap,
when absolute coordinate was expected).

gitlab #888

Change-Id: I8949a389890fcf0423b29c692c580a07fc600928

bundles/org.simantics.diagram.connection/src/org/simantics/diagram/connection/rendering/ConnectionCrossings.java

index 2367805caed2dcbc9c44a5fb72e9c897d759cd7e..6349088842521c211d6a3d5ba8385290bf8de24b 100644 (file)
@@ -229,14 +229,15 @@ public class ConnectionCrossings implements PathModifier {
                                 path2.lineTo(l.x1 + pos2 * dx, l.y1 + pos2 * dy);
                             }
                             if (pos3 < len) {
+                                pos = pos3;
                                 pos3 *= len1;
                                 double x = l.x1 + pos3 * dx;
                                 double y = l.y1 + pos3 * dy;
                                 prevGapEnd = new Point2D.Double(x, y);
                             } else {
+                                pos = pos3;
                                 finish = false;
                             }
-                            pos = pos3;
                         }
 
                         if (finish) {