How to set a zoom in/out limit in a View?


I am using the V3d_View class and I've met some problems with it, related with zoom in/out.
When the zoom in factor is too big(calling Zoom (x1, y1, x2, y2)) the application crashes. The same problem occurs when the zoom out factor is exceeded a certain threshold.

The solution is to limit the zoom in/out factors. But I can't find how to limit the zoom factor, where is the query function do to this?


Hugues's picture

It also crashes when using V3d_View::WindowFitAll, for zoom in purposes.

I have found V3d_View::Scale function, that gives the current zoom factor. What I need now is how to compute a zoom factor from data (x1, y1) and (x2, y2). From that calculation I can compare it against some predefined zoom bounds.