Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Self looping links (Read 1203 times)
Davaaron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 12th, 2018
Self looping links
Sep 25th, 2018 at 4:03pm
Print Post  
Hi,

I'm trying to set the control points of self looping links. Right now, the self loop link is at the top (the default behaviour).
I want it to be a straight line from left to right through the node.

I tried
Code (Javascript)
Select All
    link.setOriginAnchor(0);
        link.setDestinationAnchor(0);
        link.updateFromPoints(); 



and
Code (Javascript)
Select All
        newPoints.push(new Point(20, 50));
        newPoints.push(new Point(70, 50));
        link.setControlPoints(newPoints);
        link.updateFromPoints(); 



but i has not effect.
By the way, what are the coordinates for the control points? Relative to the origin? Doc or client?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: Self looping links
Reply #1 - Sep 26th, 2018 at 12:28pm
Print Post  
Hi,

At what point are you calling that code? The link might reset its shape if it becomes self-loop after the code runs.

Also the link might refuse your points if the array does not contain enough elements for link's Shape. E.g. Bezier links must specify 3 additional points for each segment after the first point, and Cascading links must contain at least 3 points to form their bend.

Coordinates are relative to diagram's (0,0) point, wherever it is located within diagram.Boudns, and specified in MeasureUnit units.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
Davaaron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 42
Joined: Jul 12th, 2018
Re: Self looping links
Reply #2 - Sep 26th, 2018 at 2:28pm
Print Post  
I'm calling that at last statement within the linkCreated event.
I will try out to add more points because I use Cascading for the links. Thanks for the hints.





  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint