Gui: workaround to show content of image plane
This workaround is needed on some platforms after the refactoring of the NaviCube code. For more details see also: https://github.com/FreeCAD/FreeCAD/pull/9356#issuecomment-1529521654
This commit is contained in:
@@ -2102,6 +2102,7 @@ void View3DInventorViewer::renderScene()
|
||||
SoGLWidgetElement::set(state, qobject_cast<QtGLWidget*>(this->getGLWidget()));
|
||||
SoGLRenderActionElement::set(state, glra);
|
||||
SoGLVBOActivatedElement::set(state, this->vboEnabled);
|
||||
drawSingleBackground(col);
|
||||
glra->apply(this->backgroundroot);
|
||||
|
||||
navigation->updateAnimation();
|
||||
@@ -3310,6 +3311,39 @@ void View3DInventorViewer::drawArrow()
|
||||
glEnd();
|
||||
}
|
||||
|
||||
void View3DInventorViewer::drawSingleBackground(const QColor& col)
|
||||
{
|
||||
// Note: After changing the NaviCube code the content of an image plane may appear black.
|
||||
// A workaround is this function.
|
||||
// See also: https://github.com/FreeCAD/FreeCAD/pull/9356#issuecomment-1529521654
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glOrtho(-1, 1, -1, 1, -1, 1);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glPushAttrib(GL_ENABLE_BIT);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glBegin(GL_TRIANGLE_STRIP);
|
||||
glColor3f(col.redF(), col.greenF(), col.blueF());
|
||||
glVertex2f(-1, 1);
|
||||
glColor3f(col.redF(), col.greenF(), col.blueF());
|
||||
glVertex2f(-1, -1);
|
||||
glColor3f(col.redF(), col.greenF(), col.blueF());
|
||||
glVertex2f(1, 1);
|
||||
glColor3f(col.redF(), col.greenF(), col.blueF());
|
||||
glVertex2f(1, -1);
|
||||
glEnd();
|
||||
glPopAttrib();
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
// ************************************************************************
|
||||
|
||||
// Set cursor graphics according to mode.
|
||||
|
||||
Reference in New Issue
Block a user