0026153: Draw Harness, ViewerTest - "verase" does not remove selection highlight...
authorisk <isk@opencascade.com>
Thu, 14 May 2015 14:04:15 +0000 (17:04 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 10 Jun 2015 08:00:44 +0000 (11:00 +0300)
src/AIS/AIS_InteractiveContext.cxx

index ef088df..2c58be9 100644 (file)
@@ -2333,9 +2333,16 @@ void AIS_InteractiveContext::EraseGlobal (const Handle(AIS_InteractiveObject)& t
 
   for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
   {
 
   for (TColStd_ListIteratorOfListOfInteger aDispModeIter (aStatus->DisplayedModes()); aDispModeIter.More(); aDispModeIter.Next())
   {
-    if (myMainPM->IsHighlighted (theIObj, aDispModeIter.Value()))
+    if (aStatus->IsHilighted())
     {
     {
-      myMainPM->Unhighlight (theIObj, aDispModeIter.Value());
+      if (IsCurrent (theIObj))
+      {
+        AddOrRemoveCurrentObject (theIObj, Standard_False);
+      }
+      else if (myMainPM->IsHighlighted (theIObj, aDispModeIter.Value()))
+      {
+        myMainPM->Unhighlight (theIObj, aDispModeIter.Value());
+      }
     }
 
     myMainPM->SetVisibility (theIObj, aDispModeIter.Value(), Standard_False);
     }
 
     myMainPM->SetVisibility (theIObj, aDispModeIter.Value(), Standard_False);