Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to Restrict overlapping of shapes? (Read 1739 times)
Kiran B
Full Member
***
Offline


I Love MindFusion!

Posts: 102
Joined: Apr 19th, 2013
How to Restrict overlapping of shapes?
May 10th, 2013 at 6:28pm
Print Post  
Hi,

How can i restrict overlapping of shapes? If i add a shape to a container that should happen. In all other cases avoid overlapping of shapes. Same is applicable for children inside the container.

Is there a fix for this?

Thanks
Kiran B
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to Restrict overlapping of shapes?
Reply #1 - May 13th, 2013 at 8:43am
Print Post  
Hi,

There is a static DiagramNode.nodesIntersect(node1, node2) method you could use to check if a pair of nodes intersect. You can call it from nodeModifying and nodeCreating handlers to check if args.getNode() intersects with any other node from diagram.nodes, and call args.setCancel(true) if it does.

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