Hi Stoyo
If the origin and the destination node of a link are wider than the nodes arranged between these start and end nodes, then the link is crossing it's origin and destination node and the nodes between are moved to the side (because of the margin).
The following picture shows the behaviour:
ShapeNode node1 = _flowchart.Factory.CreateShapeNode(0, 0, 50, 10);
node1.TextFormat.FormatFlags |= StringFormatFlags.NoClip | StringFormatFlags.NoWrap;
node1.Text = "Node 1";
node1.Bounds = new RectangleF(node1.Bounds.X, node1.Bounds.Y, node1.Bounds.Width + 20, node1.Bounds.Height);
ShapeNode node2 = _flowchart.Factory.CreateShapeNode(0, 0, 50, 10);
node2.Text = "Node 2";
ShapeNode node3 = _flowchart.Factory.CreateShapeNode(0, 0, 50, 10);
node3.TextFormat.FormatFlags |= StringFormatFlags.NoClip | StringFormatFlags.NoWrap;
node3.Text = "Node 3";
node3.Bounds = new RectangleF(node3.Bounds.X, node3.Bounds.Y, node3.Bounds.Width + 20, node3.Bounds.Height);
DiagramLink link1 = _flowchart.Factory.CreateDiagramLink(node1, node2);
DiagramLink link2 = _flowchart.Factory.CreateDiagramLink(node2, node3);
DiagramLink link3 = _flowchart.Factory.CreateDiagramLink(node1, node3);
this._diagramContainer.Diagram = _flowchart;
FlowchartLayout layout = new FlowchartLayout();
layout.Orientation = MindFusion.Diagramming.Layout.Orientation.Vertical;
layout.LinkPadding = 20;
layout.Arrange(_flowchart);
How can I prevent this behaviour? "Node 2" should be centered and the link between "Node 1" and "Node 3" shouldn't cross the nodes
Thanks in advance
Roman