Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Zoom to fit not working (Read 3881 times)
ChrisK
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: May 13th, 2015
Zoom to fit not working
Jul 2nd, 2015 at 8:53pm
Print Post  
Hello,

On a DiagramView the method zoomToFit() doesn't seem to do anything. My chart is zoomed in still. I'd ideally like it so that it's an overview of the whole thing.

DiagramView diagView = (DiagramView) findViewById(R.id.diagview);

diagView.setBehavior(Behavior.Pan);
diagView.setAntiAlias(SmoothingMode.AntiAlias);
diagView.zoomToFit();
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zoom to fit not working
Reply #1 - Jul 3rd, 2015 at 6:09am
Print Post  
Hi,

Have you populated your diagram before calling zoomToFit? It sets ZoomFactor just once to fit current diagram contents, and won't continue zooming out automatically as you add new nodes.

Stoyan
  
Back to top
 
IP Logged
 
ChrisK
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: May 13th, 2015
Re: Zoom to fit not working
Reply #2 - Jul 4th, 2015 at 1:27am
Print Post  
That makes sense, I've moved it after I create and populate my diagram.

...
layout.arrange(diagram);

and then call zoomToFit()

diagView.zoomToFit();

But that did not do anything either.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zoom to fit not working
Reply #3 - Jul 6th, 2015 at 8:16am
Print Post  
Are you sure there aren't any calls to zoom methods done later? E.g. replace the zoomToFit above with setZoomFactor(10) to see if the DiagramView will draw at 10% scale.
  
Back to top
 
IP Logged
 
ChrisK
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: May 13th, 2015
Re: Zoom to fit not working
Reply #4 - Jul 8th, 2015 at 3:44am
Print Post  
Yes, that works OK, it zooms out a lot.

layout.arrange(diagram);
diagView.setZoom(10);
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Zoom to fit not working
Reply #5 - Jul 8th, 2015 at 7:23am
Print Post  
zoomToFit result depends on current size of DiagramView. What are you seeing in log window if you print out view's getWidth() and getHeight() values?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint