/** * Hook to override creation of the vector that the marker is drawn along * since it may not be the same as the vector between any two control * points * @param points the guide points of the connector * @param source whether the marker is at the source end * @param markerSize the scaled maximum length of the marker * @return a line describing the vector the marker should be drawn along */ protected mxLine getMarkerVector(List<mxPoint> points, boolean source, double markerSize) { int n = points.size(); mxPoint p0 = (source) ? points.get(1) : points.get(n - 2); mxPoint pe = (source) ? points.get(0) : points.get(n - 1); int count = 1; // Uses next non-overlapping point while (count < n - 1 && Math.round(p0.getX() - pe.getX()) == 0 && Math.round(p0.getY() - pe.getY()) == 0) { p0 = (source) ? points.get(1 + count) : points.get(n - 2 - count); count++; } return new mxLine(p0, pe); }
/** * Hook to override creation of the vector that the marker is drawn along * since it may not be the same as the vector between any two control * points * @param points the guide points of the connector * @param source whether the marker is at the source end * @param markerSize the scaled maximum length of the marker * @return a line describing the vector the marker should be drawn along */ protected mxLine getMarkerVector(List<mxPoint> points, boolean source, double markerSize) { int n = points.size(); mxPoint p0 = (source) ? points.get(1) : points.get(n - 2); mxPoint pe = (source) ? points.get(0) : points.get(n - 1); int count = 1; // Uses next non-overlapping point while (count < n - 1 && Math.round(p0.getX() - pe.getX()) == 0 && Math.round(p0.getY() - pe.getY()) == 0) { p0 = (source) ? points.get(1 + count) : points.get(n - 2 - count); count++; } return new mxLine(p0, pe); }