]> OCCT Git - occt.git/commitdiff
0031833: Visualization - dynamic highlighting does not appear within ImmediateRedraw()
authorkgv <kgv@opencascade.com>
Fri, 9 Oct 2020 11:19:46 +0000 (14:19 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 9 Oct 2020 15:29:52 +0000 (18:29 +0300)
AIS_ViewController::contextLazyMoveTo() now undoes Z Range changes after MoveTo().

src/AIS/AIS_ViewController.cxx

index 497216a768e53c366c6d568aee7810a671380811..4823afed83cb46f2013b601219fee79f220705c6 100644 (file)
@@ -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()