Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram links overlap nodes problem. (Read 5796 times)
Yur Art
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Jun 26th, 2013
Diagram links overlap nodes problem.
Dec 5th, 2013 at 1:08pm
Print Post  
Pink border shows node borders.
Yellow-red line is connected to node's anchor point.
Blue arrow should be in front of the yellow-red line. It means that the line shouldn't be seen beneath the arrow.
So I believe solution is to hide the line beneath the node.

May be there is a way to set some visibility layers or something like this?

Or there is a way to determine that line should be behind the node?

Thank you in advance!
  

link_overlaps_node.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram links overlap nodes problem.
Reply #1 - Dec 5th, 2013 at 1:37pm
Print Post  
Why not move the anchor point to the tip of that blue arrow? You can specify that the link should be rendered behind node by setting link.ZIndex to a value smaller than node's one. You might as well try using layers, e.g. add two Layer objects to diagram.Layers, set LayerIndex of all links to 0, and LayerIndex of all nodes to 1.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Yur Art
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Jun 26th, 2013
Re: Diagram links overlap nodes problem.
Reply #2 - Dec 5th, 2013 at 2:02pm
Print Post  
Ok, Stoyan, I think that the easiest solution in my case will be to set the anchor points to the edge of the node.

But it's not very cool to see that angular square end of the link.  Undecided

ZIndex doesn't work as it should. I think that I overlooked something in my code.  Huh

Layers are absent in diagram object you told about. I believe that this is connected with the software version I use.

Thank you for the fast answer!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram links overlap nodes problem.
Reply #3 - Dec 6th, 2013 at 7:18am
Print Post  
Hi,

Layers are available since version 6 of the control. In versions older than 6, ZIndex corresponds to items index within Diagram.Items collection, and it can take values from 0 up to Items.Count - 1. Also they would not let you set ZIndex before adding an item to the diagram. Current version lets you assign arbitrary values to ZIndex.

Another solution you might try is setting link's BaseShape to that arrow instead of drawing it inside the node. You could set BaseShape to null from LinkStartModifying event handler if you don't want the arrow rendered while users drag links, and set it to the arrow shape from LinkCreated / LinkModified events.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Yur Art
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Jun 26th, 2013
Re: Diagram links overlap nodes problem.
Reply #4 - Dec 6th, 2013 at 8:20am
Print Post  
Stoyo wrote on Dec 5th, 2013 at 1:37pm:
Why not move the anchor point to the tip of that blue arrow?


I tried to change the location of the anchor point of the node. So now I face with a new problem - redrawing of the link. What is the best way to connect the link to the moved anchor point?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram links overlap nodes problem.
Reply #5 - Dec 6th, 2013 at 8:36am
Print Post  
Try resetting OriginAnchor value:

Code
Select All
var ap = link.OriginAnchor;
link.OriginAnchor = -1;
link.OriginAnchor = ap; 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Yur Art
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 6
Joined: Jun 26th, 2013
Re: Diagram links overlap nodes problem.
Reply #6 - Dec 6th, 2013 at 11:36am
Print Post  
Bull's eye Smiley All works perfectly! Cheesy
Thanks again!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint