Gui: Fix NaviCube for Qt6
This commit is contained in:
committed by
Adrián Insaurralde Avalos
parent
ff40ef3586
commit
ccaee18917
@@ -926,6 +926,7 @@ NaviCubeImplementation::PickId NaviCubeImplementation::pickFace(short x, short y
|
||||
GLubyte pixels[4] = {0};
|
||||
if (m_PickingFramebuffer && std::abs(x) <= m_CubeWidgetSize / 2 &&
|
||||
std::abs(y) <= m_CubeWidgetSize / 2) {
|
||||
static_cast<QtGLWidget*>(m_View3DInventorViewer->viewport())->makeCurrent();
|
||||
m_PickingFramebuffer->bind();
|
||||
|
||||
glViewport(0, 0, m_CubeWidgetSize * 2, m_CubeWidgetSize * 2);
|
||||
@@ -936,6 +937,7 @@ NaviCubeImplementation::PickId NaviCubeImplementation::pickFace(short x, short y
|
||||
glReadPixels(2 * x + m_CubeWidgetSize, 2 * y + m_CubeWidgetSize, 1, 1,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE, &pixels);
|
||||
m_PickingFramebuffer->release();
|
||||
static_cast<QtGLWidget*>(m_View3DInventorViewer->viewport())->doneCurrent();
|
||||
}
|
||||
return pixels[3] == 255 ? static_cast<PickId>(pixels[0]) : PickId::None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user