Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Issue with Links length on selection movement (Read 2930 times)
Shane
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 24
Joined: Mar 26th, 2009
Issue with Links length on selection movement
Mar 29th, 2009 at 2:06pm
Print Post  
Hi,

I have written event handler to create bubble zoomin and zoomout effect for the nodes on mouse enter and mouse leave for nodes in the diagram.

The issue is related to the links when multiple nodes (which are selected) are moved with mouse cursor on one of the nodes, the length of the links is changing.

I think that it is because on mouse enter we are modifying node length and thus the link connected too it is also changing its length.

Any suggestion how can i resolve the issue.

Thanks,
Shane.




« Last Edit: Mar 30th, 2009 at 12:12pm by Shane »  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Issue with Links length on selection movement
Reply #1 - Mar 30th, 2009 at 12:39pm
Print Post  
You could try setting the node's RenderTransform, instead of modifying its Bounds, or otherwise disconnect the links temporarily from the node while it is zoomed. The easiest solution might be to add a clone of the node over he original, without links connected to it, and zoom it instead of the original node.

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


I love YaBB 1G - SP1!

Posts: 24
Joined: Mar 26th, 2009
Re: Issue with Links length on selection movement
Reply #2 - Mar 31st, 2009 at 6:01am
Print Post  
Hi,

The suggestion from your last post about creating a clone of the node over the original, without links connected to it, and zoom it instead of the original node seems to fit my requirements.

Can you please elaborate on the suggestion how can implement your suggestion. A sample code will be great.

Thanks,
Shane.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Issue with Links length on selection movement
Reply #3 - Mar 31st, 2009 at 2:17pm
Print Post  
Code
Select All
void DiagramMouseMove(object sender, MouseEventArgs e)
{
	if (dummyNode != null)
	{
		Rect bounds = parentNode.Bounds;

		if (!bounds.Contains(e.GetPosition(diagram)))
		{
			diagram.Nodes.Remove(dummyNode);
			dummyNode = null;
			parentNode = null;
		}
	}
	else
	{
		DiagramNode node = diagram.GetNodeAt(e.GetPosition(diagram));

		if (node != null && node is ShapeNode)
		{
			parentNode = node as ShapeNode;
			dummyNode = (ShapeNode)parentNode.Clone(false);

			Rect newBounds = dummyNode.Bounds;
			newBounds.Inflate(20, 20);
			dummyNode.Bounds = newBounds;
			dummyNode.Text = "dummy";

			diagram.Nodes.Add(dummyNode);
		}
	}
}
 



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


I love YaBB 1G - SP1!

Posts: 24
Joined: Mar 26th, 2009
Re: Issue with Links length on selection movement
Reply #4 - Apr 1st, 2009 at 10:07am
Print Post  
Thanks for the code but can you tell me what is dummyNode and parentNode here.

Thanks again,
Shane
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Issue with Links length on selection movement
Reply #5 - Apr 1st, 2009 at 12:01pm
Print Post  
They are ShapeNode fields of the form class.

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