Fix for bug #5510:

Alt-B clipping doesn't work in side view. This seems to be a bug in
some gluUnProject implementations, used the same workaround as sculpt
mode did already.
This commit is contained in:
Brecht Van Lommel 2007-01-05 23:55:09 +00:00
parent 130f135d2a
commit 70d982f1d5

@ -2541,6 +2541,11 @@ void view3d_edit_clipping(View3D *v3d)
glGetIntegerv(GL_VIEWPORT, viewport);
glGetDoublev(GL_MODELVIEW_MATRIX, mvmatrix);
glGetDoublev(GL_PROJECTION_MATRIX, projmatrix);
/* near zero floating point values can give issues with gluUnProject
in side view on some implementations */
if(fabs(mvmatrix[0]) < 1e-6) mvmatrix[0]= 0.0;
if(fabs(mvmatrix[5]) < 1e-6) mvmatrix[5]= 0.0;
/* Set up viewport so that gluUnProject will give correct values */
viewport[0] = 0;