Salome HOME
Fix for selection by name with suffix
[modules/shaper.git] / src / GeomAPI / GeomAPI_AISObject.cpp
index 74c1e1344d81dc480eccc437576e87e86785fb4d..8510cdca30a9d27329f1e4019ec416314125db90 100644 (file)
@@ -379,13 +379,16 @@ bool GeomAPI_AISObject::setDeflection(const double theDeflection)
   bool isModified = false;
   Handle(AIS_InteractiveObject) anAIS = impl<Handle(AIS_InteractiveObject)>();
   if (!anAIS.IsNull()) {
-    Handle(Prs3d_Drawer) aDrawer = anAIS->Attributes();
-    if (fabs(aDrawer->DeviationCoefficient() - theDeflection) > Precision::Confusion()) {
-      aDrawer->SetDeviationCoefficient(theDeflection);
-      isModified = true;
+    Handle(AIS_Shape) anAISShape = Handle(AIS_Shape)::DownCast(anAIS);
+    if (!anAISShape.IsNull()) {
+      Standard_Real aCoefficient, aPreviousCoefficient;
+      anAISShape->OwnDeviationCoefficient(aCoefficient, aPreviousCoefficient);
+      if (fabs(aCoefficient-theDeflection) > Precision::Confusion()) {
+        isModified = true;
+        anAISShape->SetOwnDeviationCoefficient(theDeflection);
+      }
     }
   }
-
   return isModified;
 }