Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Keep Mouse Coordinates the same in any ZoomFactor (Read 1889 times)
solisgsandc
YaBB Newbies
*
Offline



Posts: 40
Joined: Dec 18th, 2009
Keep Mouse Coordinates the same in any ZoomFactor
Jan 7th, 2010 at 9:17pm
Print Post  
Is there an example on how to make sure that the x,y coordinates are the same in any zoom factor?

Seems like when I do a

e.GetPosition(diagram).X

or

e.GetPosition(diagram).Y

they are different in each zoom factor.

I tried this code below and still not correct.

Point newPoint = diagram.ClientToDoc(new Point(x,y));
diagram.Nodes[nodeIndex].Move(newPoint.X, newPoint.Y);
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Keep Mouse Coordinates the same in any ZoomFac
Reply #1 - Jan 7th, 2010 at 9:38pm
Print Post  
Try with e.GetPosition(diagram.DocumentPlane).
  
Back to top
 
IP Logged
 
solisgsandc
YaBB Newbies
*
Offline



Posts: 40
Joined: Dec 18th, 2009
Re: Keep Mouse Coordinates the same in any ZoomFac
Reply #2 - Jan 8th, 2010 at 4:07pm
Print Post  
Thanks a lot. That works well in different zoom factors.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint