Merge pull request #1547 from openscad/issue1523

Check error code from glReadPixels() to prevent invalid zoom.
This commit is contained in:
Marius Kintel 2016-01-10 15:40:16 -05:00
commit 10a0285f81

View file

@ -201,7 +201,12 @@ void QGLView::mouseDoubleClickEvent (QMouseEvent *event) {
double y = viewport[3] - event->pos().y() * this->getDPI();
GLfloat z = 0;
glGetError(); // clear error state so we don't pick up previous errors
glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &z);
GLenum glError = glGetError();
if (glError != GL_NO_ERROR) {
return;
}
if (z == 1) return; // outside object