Salome HOME
Merge remote-tracking branch 'remotes/origin/EDF_2020_Lot2'
[modules/shaper.git] / src / GeomAPI / GeomAPI_AISObject.cpp
index 0cf6c079fc5c54e69d6d380a5c34635619fac06e..b150bffca1345bb50a393a42901721ee072c9ebe 100644 (file)
@@ -369,15 +369,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;
 }