From: nds Date: Thu, 5 Oct 2017 17:15:10 +0000 (+0300) Subject: Crash by zoom in the viewer in a neutral point: arrows recompute should be performed... X-Git-Tag: V_2.9.0~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=760bc709211ade3dc80fe9af9067bfaa049aee2e;p=modules%2Fshaper.git Crash by zoom in the viewer in a neutral point: arrows recompute should be performed only if skech operation is active. --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 4cdd4e928..8ae275c83 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -986,29 +986,36 @@ void PartSet_Module::onViewTransformed(int theTrsfType) } if (aView.IsNull()) return; - double aLen = aView->Convert(SketcherPrs_Tools::getConfigArrowSize()); - - double aPrevLen = SketcherPrs_Tools::getArrowSize(); - 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) { - Handle(AIS_InteractiveObject) aAisObj = aAIS->impl(); - - 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; + + ModuleBase_Operation* aCurrentOperation = myWorkshop->currentOperation(); + if (aCurrentOperation && + (PartSet_SketcherMgr::isSketchOperation(aCurrentOperation) || + sketchMgr()->isNestedSketchOperation(aCurrentOperation))) + { + double aLen = aView->Convert(SketcherPrs_Tools::getConfigArrowSize()); + + double aPrevLen = SketcherPrs_Tools::getArrowSize(); + 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) { + Handle(AIS_InteractiveObject) aAisObj = aAIS->impl(); + + 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; + } } + if (isModified) + aDisplayer->updateViewer(); } - if (isModified) - aDisplayer->updateViewer(); } bool PartSet_Module::isCustomPrsActivated(const ModuleBase_CustomizeFlag& theFlag) const