Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_LengthDimension.cpp
index cee80b8b9b29ca6ad1c5abf0738c51feaf654e7d..34c7401d2d23bb865c528357a6c0d9cd633390d6 100644 (file)
@@ -94,7 +94,7 @@ void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect,
     theDimAspect->SetExtensionSize(
         (theTextSize / aViewerScale + SketcherPrs_Tools::getArrowSize()) / 2.0);
   }
-  theDimAspect->TextAspect()->SetFont(Config_PropManager::string(SKETCH_TAB_NAME,
+  theDimAspect->TextAspect()->SetFont(Config_PropManager::string("Visualization",
                                       "dimension_font").c_str());
 
   theDimAspect->SetArrowTailSize(theDimAspect->ArrowAspect()->Length());
@@ -158,7 +158,12 @@ void SketcherPrs_LengthDimension::Compute(
     myPlane = gp_Pln(mySketcherPlane->impl<gp_Ax3>());
 
     DataPtr aData = myConstraint->data();
-    AttributeDoublePtr anAttributeValue = aData->real(SketchPlugin_Constraint::VALUE());
+    AttributeDoublePtr anAttributeValue;
+    if (myConstraint->getKind() == SketchPlugin_ConstraintDistanceHorizontal::ID() ||
+        myConstraint->getKind() == SketchPlugin_ConstraintDistanceVertical::ID())
+      anAttributeValue = aData->real(SketchPlugin_ConstraintDistanceAlongDir::DISTANCE_VALUE_ID());
+    else
+      anAttributeValue = aData->real(SketchPlugin_Constraint::VALUE());
     myValue.init(anAttributeValue);
   }
 
@@ -306,6 +311,6 @@ void SketcherPrs_LengthDimension::ComputeSelection(const Handle(SelectMgr_Select
     return;
   }
   }
-  SetSelToleranceForText2d(SketcherPrs_Tools::getTextHeight());
+  SetSelToleranceForText2d(SketcherPrs_Tools::getArrowSize()/5.);
   AIS_LengthDimension::ComputeSelection(aSelection, aMode);
 }