Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Arrange links function (Read 1511 times)
Raizi
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 1
Joined: Jan 24th, 2014
Arrange links function
Jan 24th, 2014 at 1:29pm
Print Post  
I have a problem when using the MindFusion.Diagramming.Diagram,
when I have 2 links (or more) from table A to table B,
they automatically start at the same point at the Origin table and end at the same point at the destination table.
is there is a function that automatically arrange the links to not stop on each other.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Arrange links function
Reply #1 - Jan 24th, 2014 at 3:18pm
Print Post  
If you are getting such centered links after applying a layout class, try running this code after calling layout.Arrange:

Code
Select All
var links = new DiagramLinkCollection();
foreach (var link in diagram.Links)
{
	if (Math.Abs(link.StartPoint.X - link.Origin.GetCenter().X) < 1)
	{
		link.ReassignAnchorPoints();
		links.Add(link);
	}
}
diagram.LinkRouter.RouteLinks(links); 



I hope that helps,
Stoyan

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