From: kgv Date: Fri, 9 Oct 2020 11:19:46 +0000 (+0300) Subject: 0031833: Visualization - dynamic highlighting does not appear within ImmediateRedraw() X-Git-Tag: V7_5_0~36 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=cdfcd39b693d719526aca4932648ba0a3220303e;p=occt.git 0031833: Visualization - dynamic highlighting does not appear within ImmediateRedraw() AIS_ViewController::contextLazyMoveTo() now undoes Z Range changes after MoveTo(). --- diff --git a/src/AIS/AIS_ViewController.cxx b/src/AIS/AIS_ViewController.cxx index 497216a768..4823afed83 100644 --- a/src/AIS/AIS_ViewController.cxx +++ b/src/AIS/AIS_ViewController.cxx @@ -2697,8 +2697,14 @@ void AIS_ViewController::contextLazyMoveTo (const Handle(AIS_InteractiveContext) myPrevMoveTo = thePnt; Handle(SelectMgr_EntityOwner) aLastPicked = theCtx->DetectedOwner(); + + // Picking relies on the camera frustum (including Z-range) - so make temporary AutoZFit() + // and then restore previous frustum to avoid immediate layer rendering issues if View has not been invalidated. + const Standard_Real aZNear = theView->Camera()->ZNear(), aZFar = theView->Camera()->ZFar(); theView->AutoZFit(); theCtx->MoveTo (thePnt.x(), thePnt.y(), theView, false); + theView->Camera()->SetZRange (aZNear, aZFar); + Handle(SelectMgr_EntityOwner) aNewPicked = theCtx->DetectedOwner(); if (theView->Viewer()->Grid()->IsActive()