Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Links entering or exiting from a fixed position (Read 1791 times)
DavidZ
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 22
Joined: Jun 15th, 2013
Links entering or exiting from a fixed position
Jun 20th, 2013 at 9:53am
Print Post  
I was wondering if there was a way to force a link to always enter a node from the top.

I am currently using the flowchart layout but my end node is a wide ellipse because there may be many links that go to it. However in one permutation there are only two links going to it but they both go to the side. I was wondering if there was a way to force them to enter from the top.

Thanks

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Links entering or exiting from a fixed position
Reply #1 - Jun 20th, 2013 at 12:31pm
Print Post  
Hi,

Run this after applying FlowchartLayout:

Code
Select All
if (endNode.IncomingLinks.Count == 2)
{
	var c = endNode.GetCenter();
	var r = endNode.Bounds;

	foreach (var link in endNode.IncomingLinks)
	{
		if (Math.Abs(link.EndPoint.Y - r.Top) < 0.1f)
			continue;
		var nl = link.ControlPoints[link.ControlPoints.Count - 2];
		nl.Y = r.Top - 10;
		link.ControlPoints[link.ControlPoints.Count - 2] = nl;
		link.EndPoint = new PointF(c.X, nl.Y);
		link.ControlPoints.Add(new PointF(c.X, r.Top));
		link.UpdateFromPoints(false, true);
	}
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint