Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem during DiagramMouseWheel (Read 1574 times)
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Problem during DiagramMouseWheel
Jun 8th, 2009 at 2:09pm
Print Post  
Hi Stoyan,

I have sent a sample application to your support mail id, please have a look into that.

Problem :-

When MouseWheel over the diagram, I want to perform zooming. Zooming should be performed at the current location of mouse point. It is working well when my diagram captures whole screen. In this time if my mouse position is suppose (250,250),so zooming is performed by this position(This mouse position becomes center for zooming). Its good this is that which I want.

Now if I have divided screen into two parts and half of the part of screen has diagram. when I go for zooming in this diagram, diagram shifted some ward up and down position which has no relation with mouse position.

Please help us to solve this problem.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem during DiagramMouseWheel
Reply #1 - Jun 9th, 2009 at 5:36am
Print Post  
Hi,

The 'Parent' reference in your code refers to the window's Parent, which is null. It works better if you replace it with diagram.Parent, for example:

Point point = e.GetPosition(Parent as Diagram);

becomes

Point point = e.GetPosition(diagram.Parent as ScrollViewer);

and a few lines below

Point newcurpos = diagram.ClientToDoc(e.GetPosition(Parent as ScrollViewer));

becomes

Point newcurpos = diagram.ClientToDoc(e.GetPosition(diagram.Parent as ScrollViewer));

Do the same in the if (e.Delta < 0) case.

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


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Re: Problem during DiagramMouseWheel
Reply #2 - Jun 9th, 2009 at 5:46am
Print Post  
Many thanks stoyan,its working Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint