Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to get the bounds of a node at the start of dragging (Read 2778 times)
Kiran B
Full Member
***
Offline


I Love MindFusion!

Posts: 102
Joined: Apr 19th, 2013
How to get the bounds of a node at the start of dragging
Apr 20th, 2013 at 8:28am
Print Post  
Hi,

Is there any property to get the start position (x and y) of a node from which the dragging happened? I need to get this information on the NodeModifyingScript event.

function onNodeModifyingScript(sender, args) {
}

Thanks
Kiran B
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to get the bounds of a node at the start of dragging
Reply #1 - Apr 22nd, 2013 at 9:24am
Print Post  
Hi,

At this time there are only some internal fields you could use to get it:

Code
Select All
function onNodeModifying(sender, args)
{
	var node = args.getNode();
	var diagram = node.getParent();
	var savedState = diagram.interaction.interactionState.originalStates;
	var originalBounds = savedState.get(node).bounds;
} 



Alternatively, you could add your own 'originalBounds' field to nodes and update it from each nodeCreated and nodeModified event raised.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Kiran B
Full Member
***
Offline


I Love MindFusion!

Posts: 102
Joined: Apr 19th, 2013
Re: How to get the bounds of a node at the start of dragging
Reply #2 - Apr 22nd, 2013 at 2:02pm
Print Post  
Thanks Stoyan. Thanks a lot for giving insight to the hidden gems.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint