Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic LinkCreating not fired until directly on top of a ShapeNode (Read 2469 times)
j poz
Junior Member
**
Offline


I Love MindFusion!

Posts: 78
Joined: Nov 21st, 2012
LinkCreating not fired until directly on top of a ShapeNode
Oct 3rd, 2014 at 6:34pm
Print Post  
I would like the ability to draw a link from one ShapeNode to another, and have the LinkCreating event fire BEFORE the mouse is directly over the destination ShapeNode. How would I go about this?
  
Back to top
 
IP Logged
 
j poz
Junior Member
**
Offline


I Love MindFusion!

Posts: 78
Joined: Nov 21st, 2012
Re: LinkCreating not fired until directly on top of a ShapeNode
Reply #1 - Oct 3rd, 2014 at 6:38pm
Print Post  
Basically giving it a little extra area outside of the shapenode that links can be drawn to..
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LinkCreating not fired until directly on top of a ShapeNode
Reply #2 - Oct 4th, 2014 at 1:16pm
Print Post  
Check if the AutoSnapLinks and AutoSnapDistance properties do what you need. Otherwise enable the AllowUnconnectedLinks property and LinkCreating should be raised even when the pointer is away from nodes. You can set e.Cancel = true if the event-args' Destination is null to still prevent unconnected links.
  
Back to top
 
IP Logged
 
j poz
Junior Member
**
Offline


I Love MindFusion!

Posts: 78
Joined: Nov 21st, 2012
Re: LinkCreating not fired until directly on top of a ShapeNode
Reply #3 - Oct 7th, 2014 at 5:51pm
Print Post  
AutoSnapLinks worked great.

One thing about this however is that I am using the ValidateAnchorPoint event to determine if there are valid anchor points to connect to. In the situation where I am trying to connect to a shape node with no valid anchor points, it "snaps" to the nearest border point when I think it should not attempt to change the position at all if there are no valid anchors.

Can I request this change for a future MindFusion version? I have a very small source patch I can send you if you want to see the change I am proposing.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: LinkCreating not fired until directly on top of a ShapeNode
Reply #4 - Oct 8th, 2014 at 8:23am
Print Post  
That should depend on the value of the Diagram.AllowUnanchoredLinks flag; try setting it to false first. If disabling AllowUnanchoredLinks does not help, please send the patch to support@mindfusion.eu.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint