- Welcome, Guest. Please Login or Register
MindFusion  
  Version 2 of our Xamarin Calendar component adds Resource view and support for Universal Windows Platform. Now beta testing UWP version of Xamarin Diagram.  
  HomeHelpSearchLoginRegister   
     
     
   
 
Page Index Toggle Pages: 1 Send Topic Print  
Automated layout forgetting link anchor IDs
Read 47 times

Kim Lillås   Offline
YaBB Newbies
*
Posts: 22
I Love MindFusion!


   
     
 
Automated layout forgetting link anchor IDs
Oct 5th, 2017 at 5:29pm
 
Hi,

I am trying out some automated layout for the first time.

I have a set of nodes and links.

I want them to layout without changing the existing anchor selections.

However, after the layout is done, the Link.DestinationAnchor and OriginAnchor is set to -1, and visually the links no longer tie to the original anchor points.

The assignment of -1 happens during the automated layout operation. I assumed that the layout.Anchoring = Anchroing.Keep setting would force the layout to keep the link anchors?

Code:
         var layout = new MindFusion.Diagramming.Wpf.Layout.DecisionLayout();
         layout.Anchoring = Anchoring.Keep;
         layout.GrowToFit = true;
         var diagramItemCollection = new DiagramItemCollection();
         foreach (var diagramItem in MindfusionDiagram.Items.Where(x => x.GetType() != typeof(NestedDiagram)))
         {
            diagramItemCollection.Add(diagramItem);
         }

         layout.Arrange(MindfusionDiagram, diagramItemCollection); 

 
 
 
IP Logged    
 
     

Slavcho   Offline
God Member
*****
Posts: 1195
Gender: male
tech.support


   
     
 
Re: Automated layout forgetting link anchor IDs
Reply #1 - Oct 6th, 2017 at 4:53pm
 
Hi,

This build should keep them -
http://mindfusion.eu/_beta/wpfdiag_anckeep.zip

Node positions are not affected by anchor points though, the layout class aligns links to points only as a post-processing step at this time. So this could lead to links taking several U-turns to get from outgoing to incoming anchor points.

Regards,
Slavcho
 
 
 
IP Logged    
 
     

Kim Lillås   Offline
YaBB Newbies
*
Posts: 22
I Love MindFusion!


   
     
 
Re: Automated layout forgetting link anchor IDs
Reply #2 - Oct 9th, 2017 at 7:27am
 
Hello,

Thanks for the answer!

Greetings,
Kim
 
 
 
IP Logged    
 
     
Page Index Toggle Pages: 1 Send Topic Print