mirror of https://github.com/CGAL/cgal
Avoid having the visual hints hidden by the mesh when zooming too much.
This commit is contained in:
parent
5ba1ce6b44
commit
805e4669e4
|
|
@ -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<GLsizei>(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<GLsizei>(4));
|
||||
rendering_program.setUniformValue("color", QColor(::Qt::white));
|
||||
glDrawArrays(GL_LINES, 0, static_cast<GLsizei>(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]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue