From 20d233731eaae06b9a75280a2ca675bc9a11cc72 Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 7 Sep 2015 16:20:18 +0300 Subject: [PATCH] #878 Segmentation fault when setting distance on the two same points Crash by click in the same point, caused by OCCT dir2d --- src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp index 6b1dd6bec..7eeee4267 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -277,6 +277,9 @@ void SketchPlugin_ConstraintDistance::attributeChanged(const std::string& theID) } else return; + if (aEndPnt->distance(aStartPnt) < tolerance) + return; + std::shared_ptr aLineDir(new GeomAPI_Dir2d(aEndPnt->decreased(aStartPnt))); std::shared_ptr aFlyoutDir = aFlyoutPnt->xy()->decreased(aStartPnt); -- 2.39.2