Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Zooming twice using ZoomToRect creates probem (Read 6618 times)
kaykay15
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 43
Joined: Mar 11th, 2010
Zooming twice using ZoomToRect creates probem
Apr 16th, 2010 at 11:11am
Print Post  
Hello Team,

I have implemented zoomtorectangle functionaly and it's working fine when i zoom it for the first time... but when i zoom it second time, it is not working as expected.

for the first time the zoomfactor is 100% and when we zoom it to the selected rectangle then the zoomfactor changes, i think the zoomtorect is not working when the zoomfactor not equal to 100%.

Is this an known issue, are there any workarounds for this?


Thanks,
-KayKay
  

Thanks,&&-KayKay
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zooming twice using ZoomToRect creates probem
Reply #1 - Apr 18th, 2010 at 6:52am
Print Post  
Hi,

This seems to work fine regardless of the current ZoomFactor:

Code
Select All
private void Diagram_NodeDoubleClicked(object sender, MindFusion.Diagramming.Silverlight.NodeEventArgs e)
{
	diagram.ZoomToRect(e.Node.Bounds);
} 



What kind of coordinates are you setting for the zoom rectangle?

Stoyan
  
Back to top
 
IP Logged
 
kaykay15
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 43
Joined: Mar 11th, 2010
Re: Zooming twice using ZoomToRect creates probem
Reply #2 - Apr 23rd, 2010 at 6:15am
Print Post  
Hey that works fine in many of the cases but some times it fails, if the selection rectangle height is far more greater than the width..

the selected area is not in the view completely, how do i overcome this issue.


And also i am not able to find  diagram.BringIntoView() method for diagram!

Thanks,
-Kranthi
  

Thanks,&&-KayKay
Back to top
 
IP Logged
 
kaykay15
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 43
Joined: Mar 11th, 2010
Re: Zooming twice using ZoomToRect creates probem
Reply #3 - Apr 23rd, 2010 at 9:39am
Print Post  
This is the code i am using,
[code]
ContainerNode selectedRectangle = activityDiagram.Items[activityDiagram.Items.Count - 1] as ContainerNode;
if (selectedRectangle != null)
{
     activityDiagram.ZoomToRect(selectedRectangle.Bounds);
     //Removes the selection rectangle drawn by the user to select the zoom area
    activityDiagram.Items.Remove(selectedRectangle);
}
[/code]

in the above code selectedRectangle is the node drawn by the user to zoom into.

When the selected rectangle is large, zoomtorect is working as expected. and when teh selected rectangle bounds are small(equal to the node bounds) it is failing to zoom into the selected region
  

Thanks,&&-KayKay
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zooming twice using ZoomToRect creates probem
Reply #4 - Apr 23rd, 2010 at 3:14pm
Print Post  
It works fine for me.  What are your current ZoomFactor and rect.Bounds when it doesn't?
  
Back to top
 
IP Logged
 
kaykay15
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 43
Joined: Mar 11th, 2010
Re: Zooming twice using ZoomToRect creates probem
Reply #5 - Apr 26th, 2010 at 10:23am
Print Post  
Hello Stoyon,

There are many cases when the zoomtorect fails, below are the bounds and zoom factor at which it fails regularly.

Diagram bounds: {0,38,2580,851}
Selected Rectangle bounds: {849,750,154,98}
Diagram ZoomFactor : 100

How do we make the selected area to be centered in the view, i found in some fourm posts there is some method like BringIntoView(), is this still available. i am not able to find this method for the diagram control.
  

Thanks,&&-KayKay
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zooming twice using ZoomToRect creates probem
Reply #6 - Apr 26th, 2010 at 12:41pm
Print Post  
The only problem I can see is that the border of the node used as a zoom tool is hidden behind the scrollbar. This might also depend on the client area size though; what are your ActualWidth and ActualHeight for the parent scroll viewer?
  
Back to top
 
IP Logged
 
kaykay15
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 43
Joined: Mar 11th, 2010
Re: Zooming twice using ZoomToRect creates probem
Reply #7 - Apr 30th, 2010 at 6:17am
Print Post  
Hello Stoyon,

I've sent you an IM regarding steps to reproduce my issue.

This issue is not only reproducible zooming twice but it is also behaving same on zooming first time.


Please checkout the IM.
As this issue is a high priority one for us.


Thanks,
-KayKay
  

Thanks,&&-KayKay
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zooming twice using ZoomToRect creates probem
Reply #8 - Apr 30th, 2010 at 7:52am
Print Post  
Yes, I can see this in your app but cannot get it to happen in my test project. You'll have to send us a sample project that reproduces this for our developer to check what happens.

Stoyan
  
Back to top
 
IP Logged
 
kaykay15
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 43
Joined: Mar 11th, 2010
Re: Zooming twice using ZoomToRect creates probem
Reply #9 - May 3rd, 2010 at 11:16am
Print Post  
Hi Stoyo,

We have really customized our application a lot and will take much time to make a sample project which can reproduce our problem.
can you please send me your sample code so that i can verify where i am doing wrong in my code.
  

Thanks,&&-KayKay
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zooming twice using ZoomToRect creates probem
Reply #10 - May 3rd, 2010 at 12:21pm
Print Post  
Hi,

You can find my test project here:
https://mindfusion.eu/_temp/DiagliteTester.zip

Draw some nodes and then hit the "Zoom test" button at the top. Now draw around existing nodes to call diagram.ZoomToRect(e.Node.Bounds) - this works fine for me regardless of where the nodes are located.

Stoyan
  
Back to top
 
IP Logged
 
kaykay15
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 43
Joined: Mar 11th, 2010
Re: Zooming twice using ZoomToRect creates probem
Reply #11 - May 3rd, 2010 at 12:52pm
Print Post  
I've updated one of the samples provided by Mindfusion documentation to reproduce my problem.
Here you can find the http://docs.google.com/leaf?id=0B6zEK6RhNaOZMzUwOTI0NzctODUxMC00NmFiLTg0ZDktOWEx... updated code.

Steps to reproduce:
-> Run the applicaiton
-> Default diagram will be generated, now click on ZoomToRectangle Button provided
-> Draw a rectangle to create an area to zoom in
-> On Diagram MouseLeftButtonUp i have written code to zoom into the selected region

In this case it is not even zooming once to the selected region. Please have a look at this,
In the meanwhile i will look into the sample code provided by you.




  

Thanks,&&-KayKay
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zooming twice using ZoomToRect creates probem
Reply #12 - May 3rd, 2010 at 2:03pm
Print Post  
I suppose it doesn't work in that sample because there's no a ScrollViewer. ZoomToRect requires a ScrollViewer in order to set the scroll position.

Stoyan
  
Back to top
 
IP Logged
 
kaykay15
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 43
Joined: Mar 11th, 2010
Re: Zooming twice using ZoomToRect creates probem
Reply #13 - May 5th, 2010 at 11:29am
Print Post  
Hello Stoyon,

Thanks for all your effort from your side... At last my issue has been fixed, problem was with our code...Sad.

If you observe in our application there is a zoomslider at the bottom right corner, which is causing the problem.
when we select regional zoom it was setting the slider value and our max slider value was 200, Once the slider value was set again the diagram zoomfactor was setting, resulting in a two way binding...


Once again.. thanks a lot for all your effort..
  

Thanks,&&-KayKay
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zooming twice using ZoomToRect creates probem
Reply #14 - May 5th, 2010 at 12:35pm
Print Post  
Great to hear that. We'll release the new version then in a couple of hours, also containing the fix for the link crossings at segment ends you needed.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint