From 1400539941b7fe032bf5a7da6b9c0df69892c38f Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 9 Oct 2017 10:49:31 +0300 Subject: [PATCH] Issue #2271 'Fatal error' during sketching, Issue #2272 Color of a sketch-face highlight --- src/PartSet/PartSet_CustomPrs.h | 4 ++-- src/SketcherPrs/SketcherPrs_LengthDimension.cpp | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) 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()); -- 2.39.2