+ private void recalculateEffectivePath()\r
+ {\r
+ Point pos1 = pin1.getPos(), pos2 = pin2.getPos();\r
+\r
+ double boundsX1 = Math.min(pos1.x, pos2.x);\r
+ double boundsY1 = Math.min(pos1.y, pos2.y);\r
+ double boundsX2 = Math.max(pos1.x, pos2.x);\r
+ double boundsY2 = Math.max(pos1.y, pos2.y);\r
+\r
+ if (path == null)\r
+ effectivePath = new double[] { pos1.x, pos1.y, (pos1.x + pos2.x) / 2, pos1.y, (pos1.x + pos2.x) / 2, pos2.y, pos2.x, pos2.y };\r
+ else\r
+ {\r
+ effectivePath = new double[path.length * 2 + 4];\r
+ effectivePath[0] = pos1.x;\r
+ effectivePath[1] = pos1.y;\r
+ for (int srcI = 0, dstI = 2; srcI < path.length; srcI++, dstI += 2)\r
+ {\r
+ double pathX = path[srcI].x;\r
+ double pathY = path[srcI].y;\r
+ effectivePath[dstI + 0] = pathX;\r
+ effectivePath[dstI + 1] = pathY;\r
+ if (pathX < boundsX1)\r
+ boundsX1 = pathX;\r
+ if (pathX > boundsX2)\r
+ boundsX2 = pathX;\r
+ if (pathY < boundsY1)\r
+ boundsY1 = pathY;\r
+ if (pathY > boundsY2)\r
+ boundsY2 = pathY;\r
+ }\r
+ effectivePath[effectivePath.length - 2] = pos2.x;\r
+ effectivePath[effectivePath.length - 1] = pos2.y;\r
+ }\r
+\r
+ bounds.x = boundsX1;\r
+ bounds.y = boundsY1;\r
+ bounds.width = boundsX2 - boundsX1;\r
+ bounds.height = boundsY2 - boundsY1;\r
+ }\r
+\r