Commit 489f1a73 authored by Emden R. Gansner's avatar Emden R. Gansner

Fix case for curved edges when centroid is identical to the midpoint of an edge

parent 488329be
......@@ -918,6 +918,7 @@ static void bend(pointf spl[4], pointf centroid)
double vX = centroid.x - midpt.x;
double vY = centroid.y - midpt.y;
double magV = sqrt(vX*vX + vY*vY);
if (magV == 0) return; /* if midpoint == centroid, don't divide by zero */
a.x = midpt.x - vX / magV * r; /* + would be closest point */
a.y = midpt.y - vY / magV * r;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment