Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic diagram selfLoops (Read 2057 times)
billcollis
YaBB Newbies
*
Offline


I love mindfusion

Posts: 19
Location: Auckland, NZ
Joined: Jun 4th, 2011
diagram selfLoops
Jul 6th, 2015 at 10:31pm
Print Post  
can we disable selfLoops in the diagram?
thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: diagram selfLoops
Reply #1 - Jul 7th, 2015 at 7:57am
Print Post  
At this time you can disable them only by handling validation events:

Code
Select All
function onLinkCreating(sender, args)
{
	var link = args.getLink();
	if (!link.targetConnection)
		return;

	var origin = link.getOrigin();
	var dest = link.targetConnection.node;
	if (origin == dest)
		args.setCancel(true);
}

function onLinkModifying(sender, args)
{
	var link = args.getLink();
	if (!link.targetConnection)
		return;

	var origin = args.adjustmentHandle == 0 ?
		link.targetConnection.node : link.getOrigin();
	var dest = args.adjustmentHandle == link.points.length - 1 ?
		link.targetConnection.node : link.getDestination();

	if (origin == dest)
		args.setCancel(true);
} 



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