1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0026599: Visualization, TKOpenGl - gradient background should reset model transformation in Core profile

OpenGl_View::DrawBackground() - reset ModelWorldState as wellm not just WorldViewState.
Test case for issue CR26599
This commit is contained in:
kgv
2015-08-27 13:49:39 +03:00
committed by ski
parent b080448780
commit e43a4f2bd9
2 changed files with 34 additions and 4 deletions

View File

@@ -173,12 +173,14 @@ void OpenGl_View::DrawBackground (const Handle(OpenGl_Workspace)& theWorkspace)
aCtx->core11fwd->glDisable (GL_DEPTH_TEST);
}
aCtx->WorldViewState.Push();
aCtx->ProjectionState.Push();
aCtx->WorldViewState.SetIdentity();
aCtx->WorldViewState.Push();
aCtx->ModelWorldState.Push();
aCtx->ProjectionState.SetIdentity();
aCtx->WorldViewState.SetIdentity();
aCtx->ModelWorldState.SetIdentity();
aCtx->ApplyProjectionMatrix();
aCtx->ApplyWorldViewMatrix();
aCtx->ApplyModelViewMatrix();
// Drawing background gradient if:
// - gradient fill type is not Aspect_GFM_NONE and
@@ -234,10 +236,11 @@ void OpenGl_View::DrawBackground (const Handle(OpenGl_Workspace)& theWorkspace)
theWorkspace->SetAspectFace (anOldAspectFace);
}
aCtx->ModelWorldState.Pop();
aCtx->WorldViewState.Pop();
aCtx->ProjectionState.Pop();
aCtx->ApplyProjectionMatrix();
aCtx->ApplyWorldViewMatrix();
aCtx->ApplyModelViewMatrix();
if (wasUsedZBuffer)
{