Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » ZoomManager bug?!
ZoomManager bug?! [message #240848] Mon, 21 January 2008 11:19
Eclipse UserFriend
Originally posted by: cfondacci.free.fr

Hello all,

I think the zoom manager has a bug which took me hours of debugging my
application.

Here it is :
If you ever call the ZoomManager.zoomAsText with the FIT_PAGE, FIT_HEIGHT or
FIT_WIDTH constants while your GEF viewer has 0-sized bounds you will NEVER
be able to get a FIT_xx zoom again.

This happened for me because I had a size listener on the viewer's control
which performs a ZOOM_FIT to always display the full diagram inside my RCP
view.

The reason is that the "getFitXZoomLevel" method is multiplying the
available width & height by the current zoom factor to compute the scale. So
if for any reason your zoom factor is 0 (which happens when your control is
0-sized), it will stay to 0 forever.

The workaround is to always check your viewer's control size and ensure it
is not 0-width or 0-height before calling the zoomAsText method...

Should I submit a bug?

Later,
Christophe.
Previous Topic:Model/Controller Connection to slow...
Next Topic:how to launch a wizard when drag and drop an item from palette ?
Goto Forum:
  


Current Time: Sat Dec 20 04:29:08 GMT 2014

Powered by FUDForum. Page generated in 0.01542 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software