From: nds Date: Mon, 9 Oct 2017 07:49:31 +0000 (+0300) Subject: Issue #2271 'Fatal error' during sketching, Issue #2272 Color of a sketch-face highlight X-Git-Tag: V_2.9.0~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1400539941b7fe032bf5a7da6b9c0df69892c38f;p=modules%2Fshaper.git Issue #2271 'Fatal error' during sketching, Issue #2272 Color of a sketch-face highlight --- diff --git a/src/PartSet/PartSet_CustomPrs.h b/src/PartSet/PartSet_CustomPrs.h index fc8359681..65c3bdf09 100755 --- a/src/PartSet/PartSet_CustomPrs.h +++ b/src/PartSet/PartSet_CustomPrs.h @@ -56,8 +56,8 @@ public: /// Returns color lighter than sketch feature entity : pink static const std::string OPERATION_REMOVE_FEATURE_COLOR() { return "255, 174, 201"; } - /// Returns color equal to default color of construction plugin : gray - static const std::string OPERATION_SKETCH_PLANE() { return "150,150,180"; } + /// Returns color equal to default color of construction plugin : green + static const std::string OPERATION_SKETCH_PLANE() { return "170,255,0"; } public: /// Constructor /// \param theWorkshop a reference to workshop diff --git a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp index 7472d956b..cee80b8b9 100644 --- a/src/SketcherPrs/SketcherPrs_LengthDimension.cpp +++ b/src/SketcherPrs/SketcherPrs_LengthDimension.cpp @@ -261,6 +261,15 @@ bool SketcherPrs_LengthDimension::readyToDisplay(ModelAPI_Feature* theConstraint if (!aPnt_A || !aPnt_B) // Objects not found return false; + if (theConstraint->getKind() == SketchPlugin_ConstraintDistanceHorizontal::ID()) { + if (fabs(aPnt_A->x() - aPnt_B->x()) < Precision::Confusion()) + return false; + } + else if (theConstraint->getKind() == SketchPlugin_ConstraintDistanceVertical::ID()) { + if (fabs(aPnt_A->y() - aPnt_B->y()) < Precision::Confusion()) + return false; + } + // Get points from these object std::shared_ptr aPoint1 = thePlane->to3D(aPnt_A->x(), aPnt_A->y()); std::shared_ptr aPoint2 = thePlane->to3D(aPnt_B->x(), aPnt_B->y());