Hi Don,
Please set a breakpoint at the start of this code and check how many points are there in the link, and what is the link.Style value:
// GET the First point that the link starts from.
points.Add(new Point(link.ControlPoints[0].X, link.ControlPoints[0].Y));
// add the next two middle points
for (int x = 0; x < pointList.Count; x++)
{
Point point = new Point
{
X = pointList[x].localXPosition,
Y = pointList[x].localYPosition
};
points.Add(point);
}
// Add the Last Point
points.Add(new Point(link.ControlPoints[1].X, link.ControlPoints[1].Y));
It seems that code expects that each link is a polyline with one segment / two points when it runs? If you get links with a different number of points, you are in trouble, because you might be setting one of the intermediate points location as the final end point of the link. So instead of adding ControlPoints[1], try adding ControlPoints[ControlPoints.Count - 1].
I've just recalled you had an issue where the text was not centered by default for Bezier links, because the intermediate points where not distributed correctly along the link length, but all were placed at the link's end. We've fixed this, and now ControlPoints[1] is not at the link's end, but nearer to the start point. I'm pretty sure that causes the problem in your link loading code now.
I hope that helps,
Stoyan