From: vsv Date: Wed, 29 Nov 2017 10:37:31 +0000 (+0300) Subject: Issue #2292: Calculate selection tolerance of dimension text X-Git-Tag: V_2.10.0RC~129 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=053649c28b7fa0b406754782cfdfcb77ebad549f;p=modules%2Fshaper.git Issue #2292: Calculate selection tolerance of dimension text --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 57d9fc6b7..a4ec9046e 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -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 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; } diff --git a/src/SketcherPrs/SketcherPrs_Angle.cpp b/src/SketcherPrs/SketcherPrs_Angle.cpp index d1735600b..c8f79b464 100644 --- a/src/SketcherPrs/SketcherPrs_Angle.cpp +++ b/src/SketcherPrs/SketcherPrs_Angle.cpp @@ -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); } diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp index 5f9b54cff..12e9e1270 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp @@ -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); } diff --git a/src/SketcherPrs/SketcherPrs_Radius.cpp b/src/SketcherPrs/SketcherPrs_Radius.cpp index 3381d5d63..8fa795e90 100644 --- a/src/SketcherPrs/SketcherPrs_Radius.cpp +++ b/src/SketcherPrs/SketcherPrs_Radius.cpp @@ -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); }