Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic A question about Diagram's AllowSelfLoops! (Read 1805 times)
chowy
Junior Member
**
Offline


I Love MindFusion!

Posts: 72
Joined: May 8th, 2017
A question about Diagram's AllowSelfLoops!
Mar 9th, 2018 at 8:14am
Print Post  
when I set the diagram.AllowSelfLoops=true;Then, node connects its own anchorPoint. The result is not ideal.Please see the attached screenshot.It is normal for me to connect different Nodes.
  

linkSelf.png (Attachment deleted)
linkSelf2.png (Attachment deleted)
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: A question about Diagram's AllowSelfLoops!
Reply #1 - Mar 9th, 2018 at 10:03am
Print Post  
Hi,

You can handle the Diagram.SetSelfLoopShape event and adjust the link origin and destination anchors. For example:
Code
Select All
void diagram_SetSelfLoopShape(object sender, LinkShapeEventArgs e)
{
    var link = e.Link;
    link.Shape = LinkShape.Cascading;

    link.OriginAnchor = 1;
    link.DestinationAnchor = 2;
    link.Route();

    e.Handled = true;
} 



The above code produces the result in the attached image.

Regards,
Lyubo
  

anchors.PNG (Attachment deleted)
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint