Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Attach Node Bounds (Read 1326 times)
DSspirit
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 10
Joined: Nov 3rd, 2009
Attach Node Bounds
Mar 1st, 2010 at 2:18pm
Print Post  
Hello,

I'm trying to connect nodes, specifically shapenodes, without links or at least to appear as though no links have been created. Is there any method to attach nodes based on bounds or sides or will I need to do a search for each node's bounding box and see what nodes overlap and then snap them to the edge of the previous node? Thanks for any help!

-DS
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Attach Node Bounds
Reply #1 - Mar 1st, 2010 at 4:11pm
Print Post  
Hi,

There isn't any builtin method. I suppose you could use the GetNodeAt(threshold) method to find a node nearby the created or modified one, and then call e.Node.AttachTo(nearByNode, AttachToNode.X) to attach to that node. Choose a X value that corresponds to the nodes relative position, and implement snapping by setting e.Node.Bounds in such a way that the nodes Left/Right or Top/Bottom coordinates are aligned.

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