Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Link crossing with Origin and Destination (Read 2317 times)
roman
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Feb 8th, 2011
Link crossing with Origin and Destination
May 9th, 2011 at 7:09am
Print Post  
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:



Code
Select All
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
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link crossing with Origin and Destination
Reply #1 - May 9th, 2011 at 10:49am
Print Post  
Hi Roman,

It seems the algorithm assumes that branches will always occupy more space than the start and end nodes. Our developers will try to fix this for the next release. Now you can work around this only by changing the nodes size before calling Arrange and restoring it afterwards.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link crossing with Origin and Destination
Reply #2 - May 11th, 2011 at 7:56pm
Print Post  
Hi Roman,

This version should fix the overlapping problem and ensures that if there is a single non-empty branch, it is centered below the decision node:
https://mindfusion.eu/_beta/fcnet563.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
roman
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Feb 8th, 2011
Re: Link crossing with Origin and Destination
Reply #3 - May 12th, 2011 at 6:18am
Print Post  
Hi Stoyo

Thanks for your reply. I'll try this out.

Roman
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint