Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Fit to window problem with hidden nodes (Read 2819 times)
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Fit to window problem with hidden nodes
Oct 12th, 2009 at 1:06pm
Print Post  
Hi Stoyan,


I am having set of nodes in my application.

I want to perform FitToScreen operation on them for which I have implemented ZoomToFit method in my application. This ZoomToFit method displays all diagram contents in the visible client area.

Now I want to hide some nodes and want to perform ZoomToFit for all diagram item.
In this case it is performing ZoomToFit for only visible items, I want ZoomToFit for all the items of the diagram(hiden as well).

I have also set the property "diagram.ResizeToFitItems(10,false);"" for this purpose but it is not working.


Please suggest for this.

Regards,
Anshul




  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Fit to window problem with hidden nodes
Reply #1 - Oct 12th, 2009 at 2:32pm
Print Post  
You should set the boolean parameter of ResizeToFitItems to true.
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Fit to window problem with hidden nodes
Reply #2 - Oct 12th, 2009 at 2:40pm
Print Post  
Hi Stoyan,

Thanks for quick reply.

We have already tried this , but it is not working.
You can check this with the Sample.
Please suggest something .

Thanks,
Anshul

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Fit to window problem with hidden nodes
Reply #3 - Oct 12th, 2009 at 3:05pm
Print Post  
What ZoomToFit does is

Rect contentRect = GetContentBounds(false, true);
ZoomToRect(contentRect);

so you might call

diagram.ZoomToRect(GetContentBounds(false, false));
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Fit to window problem with hidden nodes
Reply #4 - Oct 12th, 2009 at 3:26pm
Print Post  
Thanks Stoyan Smiley
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Fit to window problem with hidden nodes
Reply #5 - Oct 13th, 2009 at 5:06pm
Print Post  
Hi Stoyan,

It is not working as expected.

Steps to follow.
1.Run sample.
2.Click on fit to screen.
3.Hide boundry nodes.
4.Click on fit to screen.
5.Click on Show button.
6.Some nodes(some part of previousely hidden nodes) are out of window.


Please suggest for this.

Regards,
Anshul.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Fit to window problem with hidden nodes
Reply #6 - Oct 16th, 2009 at 6:23am
Print Post  
Replace diagram.ZoomToFit() with diagram.ZoomToRect(diagram.GetContentBounds(false, false)) in your FitToScreen method and it will work as expected.
  
Back to top
 
IP Logged
 
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Re: Fit to window problem with hidden nodes
Reply #7 - Oct 16th, 2009 at 11:55am
Print Post  
Thanks Stoyan Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint