Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Movement of an DiagramNode within ContainerNode (Read 1746 times)
Kuzya
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 45
Joined: Dec 19th, 2011
Movement of an DiagramNode within ContainerNode
Mar 21st, 2014 at 9:16am
Print Post  
Hello together,
If I shift a DiagramNode within ContainerNode, I would like to check the direction of movement.
How can I make this?


Many thanks in advance
Kyzya
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Movement of an DiagramNode within ContainerNode
Reply #1 - Mar 21st, 2014 at 11:05am
Print Post  
Hi,

Try this if you need to detect the direction in which the user moves a node interactively:

Code
Select All
PointF startPoint = new PointF();

private void diagram_NodeStartModifying(object sender, NodeValidationEventArgs e)
{
	startPoint = e.Node.GetCenter();
}

private void diagram_NodeModified(object sender, NodeEventArgs e)
{
	var currentPoint = e.Node.GetCenter();
	bool left = currentPoint.X < startPoint.X;
	bool right = currentPoint.X > startPoint.X;
	bool up = currentPoint.Y < startPoint.Y;
	bool down = currentPoint.Y > startPoint.Y;
} 



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


I love YaBB 1G - SP1!

Posts: 45
Joined: Dec 19th, 2011
Re: Movement of an DiagramNode within ContainerNode
Reply #2 - Mar 21st, 2014 at 12:29pm
Print Post  
Thank you very much! The solution is perfect!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint