From cdfcd39b693d719526aca4932648ba0a3220303e Mon Sep 17 00:00:00 2001 From: kgv Date: Fri, 9 Oct 2020 14:19:46 +0300 Subject: [PATCH] 0031833: Visualization - dynamic highlighting does not appear within ImmediateRedraw() AIS_ViewController::contextLazyMoveTo() now undoes Z Range changes after MoveTo(). --- src/AIS/AIS_ViewController.cxx | 6 ++++++ 1 file changed, 6 insertions(+) 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() -- 2.39.5