Hi everyone. I'm experimenting with an application to graphically display the parse tree of a script file, and I'm having some issues getting cascading links to consistently go down and then across, as illustrated here:
![mfd-cascading-link-issue.png mfd-cascading-link-issue.png](http://g.imagehost.org/0241/mfd-cascading-link-issue.png)
Originally, I just drew the links initially as single-segment polylines, then created a TreeLayout object (link style=cascading3), configured it and used the UpdateLink method to get the cascading links. This worked perfectly, but was too slow -- the real-world script files we'd be examining with this application can result in diagrams with up to 20,000 links or more, and iterating through all of those to update them added 50% or more to the processing time needed to draw the diagram.
So instead I thought I'd try to just draw the links in tree form when initially creating the diagram. I set the Diagram object's LinkStyle to Cascading and LinkSegments to 2, and manually set the anchoring on each node like so:
AnchorPattern anchors = new AnchorPattern(new AnchorPoint[] {
new AnchorPoint(0, 50, true, false),
new AnchorPoint(Math.Min((DELTA_X / 2) / lNode.Bounds.Width * 100, 85), 100, false, true),
new AnchorPoint(100, 50, false, true)
}
);
And this is what gets me the behavior illustrated in the screenshot above. It seems to be related to the size of the node at the source of the link, as I've been able to reproduce it by shortening nodes (for example, the when I edited the script to change the "else" in the screenshot above to just "e", the link under that node also routed incorrectly).
Is there anything I can do to get these links to route consistently without having to use TreeLayout.UpdateLink() after creating the link?