]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2292: Calculate selection tolerance of dimension text
authorvsv <vsv@opencascade.com>
Wed, 29 Nov 2017 10:37:31 +0000 (13:37 +0300)
committervsv <vsv@opencascade.com>
Wed, 29 Nov 2017 10:37:31 +0000 (13:37 +0300)
src/PartSet/PartSet_Module.cpp
src/SketcherPrs/SketcherPrs_Angle.cpp
src/SketcherPrs/SketcherPrs_LengthDimension.cpp
src/SketcherPrs/SketcherPrs_Radius.cpp

index 57d9fc6b7556b3eb5eacd53e29ab1f6f85d77c06..a4ec9046ec616feadceae2148caa2ef1629215ee 100755 (executable)
@@ -1004,8 +1004,6 @@ void PartSet_Module::onViewTransformed(int theTrsfType)
     SketcherPrs_Tools::setArrowSize(aLen);
     const double aCurScale = aViewer->activeView()->Camera()->Scale();
     aViewer->SetScale(aViewer->activeView(), aCurScale);
-    double aTextHeight = SketcherPrs_Tools::getConfigTextHeight();
-    SketcherPrs_Tools::setTextHeight (aTextHeight);
     bool isModified = false;
     QList<AISObjectPtr> aPrsList = aDisplayer->displayedPresentations();
     foreach (AISObjectPtr aAIS, aPrsList) {
@@ -1014,7 +1012,6 @@ void PartSet_Module::onViewTransformed(int theTrsfType)
       Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(aAisObj);
       if (!aDim.IsNull()) {
         aDim->DimensionAspect()->ArrowAspect()->SetLength(aLen);
-        aDim->DimensionAspect()->TextAspect()->SetHeight(aTextHeight);
         aContext->Redisplay(aDim, false);
         isModified = true;
       }
index d1735600bd935f063824ce95a6954cb9cce69d59..c8f79b464d7f1b696f4b4a56cf0b1e8fc69688cc 100644 (file)
@@ -281,7 +281,7 @@ void SketcherPrs_Angle::ComputeSelection(const Handle(SelectMgr_Selection)& aSel
     return;
   }
   }
-  SetSelToleranceForText2d(SketcherPrs_Tools::getTextHeight());
+  SetSelToleranceForText2d(SketcherPrs_Tools::getArrowSize()/5.);
   AIS_AngleDimension::ComputeSelection(aSelection, aMode);
 }
 
index 5f9b54cff59faad8698f26c9d2715c414c016ef8..12e9e1270ee0a6352d324ac84066a855f4c4a695 100644 (file)
@@ -311,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);
 }
index 3381d5d63a81921dcb339e33a31362801fcd7b7f..8fa795e90b4e94c4d29122700ac908c701c1476a 100644 (file)
@@ -202,6 +202,6 @@ void SketcherPrs_Radius::ComputeSelection(const Handle(SelectMgr_Selection)& aSe
     return;
   }
   }
-  SetSelToleranceForText2d(SketcherPrs_Tools::getTextHeight());
+  SetSelToleranceForText2d(SketcherPrs_Tools::getArrowSize()/5.);
   AIS_RadiusDimension::ComputeSelection(aSelection, aMode);
 }