Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic routing doesn't move to different anchorpoint (Read 2924 times)
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
routing doesn't move to different anchorpoint
Jan 24th, 2013 at 1:50am
Print Post  
With the applet, links switched anchorpoint to the nearest, when a node related to the link was moved.
Is there a setting with the same result in js ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: routing doesn't move to different anchorpoint
Reply #1 - Jan 24th, 2013 at 10:42am
Print Post  
You could move the end points from a nodeModified handler:

Code
Select All
function onNodeModified(sender, args)
{
	var node = args.getNode();
	var links = node.getAllLinks();
	Array.forEach(links, function (link)
	{
		link.originConnection.chooseBestAnchorPoint(link.getEndPoint())
		link.setStartPoint(link.originConnection.anchorPointDetails.point);
		link.destinationConnection.chooseBestAnchorPoint(link.getStartPoint())
		link.setEndPoint(link.destinationConnection.anchorPointDetails.point);
	});
	node.getParent().routeAllLinks();
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
hans
Junior Member
**
Offline


I Love MindFusion!

Posts: 81
Location: Netherlands
Joined: Mar 17th, 2012
Re: routing doesn't move to different anchorpoint
Reply #2 - Jan 24th, 2013 at 3:37pm
Print Post  
I get an error:
link.setEndPoint and link.setEndPoint not defined.

so I used
link.points[0]=link.originConnection.anchorPointDetails.point;
and link.points[link.points.length-1]=...

then it works well

thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: routing doesn't move to different anchorpoint
Reply #3 - Jan 25th, 2013 at 7:56am
Print Post  
Ok, our developer probably used a bit newer version than yours, that includes these shortcut methods for setting first and last points in links. You can find our latest build here:
https://mindfusion.eu/_beta/jsdiag_start_end.zip
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint