return;
} else {
Coordinate lineStart = p1.sub(coordOrigin);
Coordinate lineEnd = p2.sub(coordOrigin);
double lineLength = lineStart.getDistanceTo(lineEnd);
Coordinate lineVector = lineEnd.sub(lineStart);
double segmentLength = lineLength / (2 * Math.ceil(lineLength / (2 * dashLength)));
double startFactor = 0;
double dFactor = segmentLength / lineLength;
boolean on = true;
while (startFactor < 1) {
double endFactor = startFactor + dFactor;
if (endFactor > 1) {
endFactor = 1;
}
if (on) {
Coordinate start = lineStart.add(lineVector.mult(startFactor));
Coordinate end = lineStart.add(lineVector.mult(endFactor));
g.drawLine(start.x, start.y, end.x, end.y);
}
startFactor = endFactor;
on = !on;