Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic TreeLayout and negative Coordinates (Read 2798 times)
Gabriel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 30
Joined: Oct 9th, 2012
TreeLayout and negative Coordinates
Jan 24th, 2014 at 12:31pm
Print Post  
Hello,
I have a flowchart where I'm allowing to expand the canvas in all directions, so the nodes could have negative coordinates.
However when I apply a Treelayout to the flowchart, the nodes are always placed on the positive region of the canvas, so the root node is moved also even if "keeprootposition" flag is turned to yes.

Is there any way to allow the Treelayout to have nodes on with negative coordinates?

Thank you
Gabriel
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TreeLayout and negative Coordinates
Reply #1 - Jan 24th, 2014 at 2:55pm
Print Post  
Hi,

This leaves the root at negative coordinates in my test project:
Code
Select All
private void diagram_NodeClicked(object sender, NodeEventArgs e)
{
	var layout = new TreeLayout();
	layout.Root = e.Node;
	layout.KeepRootPosition = true;
	layout.LinkStyle = TreeLayoutLinkType.Cascading3;
	layout.Arrange(diagram);
} 





What TreeLayout settings are you using?

Stoyan
  
Back to top
 
IP Logged
 
Gabriel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 30
Joined: Oct 9th, 2012
Re: TreeLayout and negative Coordinates
Reply #2 - Jan 27th, 2014 at 7:13am
Print Post  
Hello these are my config parameters:

Code
Select All
 MindFusion.Diagramming.Layout.TreeLayout treeLayout =

new MindFusion.Diagramming.Layout.TreeLayout(
                                                                              node,
                                                                              MindFusion.Diagramming.Layout.TreeLayoutType.Centered,
                                                                              false,
                                                                              MindFusion.Diagramming.Layout.TreeLayoutLinkType.Cascading3,
                                                                              MindFusion.Diagramming.Layout.TreeLayoutDirections.TopToBottom,
                                                                              levelDistance,
                                                                              nodeDistance,
                                                                              true,
                                                                              new SizeF(10, 10))
                                                                              {
                                                                                  EnableAssistants = true,
                                                                                  CompactAssistants = true,
                                                                              }; 

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TreeLayout and negative Coordinates
Reply #3 - Jan 27th, 2014 at 11:29am
Print Post  
That works as well in my test project. What version of the control are you using?
  
Back to top
 
IP Logged
 
Gabriel
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 30
Joined: Oct 9th, 2012
Re: TreeLayout and negative Coordinates
Reply #4 - Jan 27th, 2014 at 2:10pm
Print Post  
Hello,

I'm using the 5.8.23715 version of the dll

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: TreeLayout and negative Coordinates
Reply #5 - Jan 27th, 2014 at 6:08pm
Print Post  
I have installed version 5.8 and changed the rearrange method in TreeLayout sample project to this:

Code
Select All
private void rearrange()
{
	rootNode.Move(-300,-300);
	MindFusion.Diagramming.Layout.TreeLayout treeLayout =
		new MindFusion.Diagramming.Layout.TreeLayout(
		  rootNode,
		  MindFusion.Diagramming.Layout.TreeLayoutType.Centered,
		  false,
		  MindFusion.Diagramming.Layout.TreeLayoutLinkType.Cascading3,
		  MindFusion.Diagramming.Layout.TreeLayoutDirections.TopToBottom,
		  10,
		  5,
		  true,
		  new SizeF(10, 10))
	{
		EnableAssistants = true,
		CompactAssistants = true,
	};
	treeLayout.Arrange(diagram);

	diagram.ResizeToFitItems(5);
	rootNode.Text = rootNode.Bounds.Location.ToString();
} 



The root node shows location -300,-300, so that seems to work correctly. Check if you don't have some code running after TreeLayout.Arrange that moves the diagram elements back to positive coordinates.

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