From 805e4669e45385720af9440e1cb4fb237a34a743 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 20 Aug 2018 17:12:19 +0200 Subject: [PATCH] Avoid having the visual hints hidden by the mesh when zooming too much. --- GraphicsView/include/CGAL/Qt/qglviewer_impl.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h index 972896a063a..a405b1d8670 100644 --- a/GraphicsView/include/CGAL/Qt/qglviewer_impl.h +++ b/GraphicsView/include/CGAL/Qt/qglviewer_impl.h @@ -3164,7 +3164,9 @@ void CGAL::QGLViewer::drawVisualHints() { int size = 100; glViewport(width()*devicePixelRatio()-size, height()*devicePixelRatio()-size, size, size); glScissor (width()*devicePixelRatio()-size, height()*devicePixelRatio()-size, size, size); + glDisable(GL_DEPTH_TEST); glDrawArrays(GL_TRIANGLES, 0, static_cast(axis_size / 9)); + glEnable(GL_DEPTH_TEST); // The viewport and the scissor are restored. glScissor(scissor[0],scissor[1],scissor[2],scissor[3]); glViewport(viewport[0],viewport[1],viewport[2],viewport[3]); @@ -3199,9 +3201,11 @@ void CGAL::QGLViewer::drawVisualHints() { glScissor (GLint((camera()->projectedCoordinatesOf(camera()->pivotPoint()).x-size/2)*devicePixelRatio()), GLint((height() - camera()->projectedCoordinatesOf(camera()->pivotPoint()).y-size/2)*devicePixelRatio()), size, size); rendering_program.setUniformValue("color", QColor(::Qt::black)); + glDisable(GL_DEPTH_TEST); glDrawArrays(GL_LINES, 0, static_cast(4)); rendering_program.setUniformValue("color", QColor(::Qt::white)); glDrawArrays(GL_LINES, 0, static_cast(4)); + glEnable(GL_DEPTH_TEST); // The viewport and the scissor are restored. glScissor(scissor[0],scissor[1],scissor[2],scissor[3]); glViewport(viewport[0],viewport[1],viewport[2],viewport[3]);