]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAPI/GeomAPI_AISObject.cpp
Salome HOME
Issue #3262: Undo automatic constraint even several conflicting objects were sent
[modules/shaper.git] / src / GeomAPI / GeomAPI_AISObject.cpp
index ac3a6ff4d2f2341954e610a386b62647ed0371f6..ae3ebdab0f2d916455f243dfa67714f05ad2c0da 100644 (file)
@@ -370,15 +370,19 @@ bool GeomAPI_AISObject::setColor(int theR, int theG, int theB)
   if (aColor.IsEqual(aCurrentColor))
     return false;
 
+  Handle(AIS_InteractiveContext) aContext = anAIS->GetContext();
   Handle(AIS_Dimension) aDimAIS = Handle(AIS_Dimension)::DownCast(anAIS);
   if (!aDimAIS.IsNull()) {
     aDimAIS->DimensionAspect()->SetCommonColor(aColor);
+    if (!aContext.IsNull())
+      aContext->Redisplay(aDimAIS, false);
+  }
+  else {
+    if (!aContext.IsNull())
+      aContext->SetColor(anAIS, aColor, false);
+    else
+      anAIS->SetColor(aColor);
   }
-  Handle(AIS_InteractiveContext) aContext = anAIS->GetContext();
-  if (!aContext.IsNull())
-    aContext->SetColor(anAIS, aColor, false);
-  else
-    anAIS->SetColor(aColor);
   return true;
 }