From 278a7bcfb9c70d518c2fb847b2cfc39dea5a3131 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 16 Sep 2015 16:01:04 +0300 Subject: [PATCH] Fix for a regression: create a point(0, 0), start line creation, select the point as the line start point. The control did not lost the focus, because the attribute default value is (0,0). Initialize flag of the attribute should be checked. --- src/PartSet/PartSet_WidgetPoint2d.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PartSet/PartSet_WidgetPoint2d.cpp b/src/PartSet/PartSet_WidgetPoint2d.cpp index 7e0b3cc05..d94afa5a0 100644 --- a/src/PartSet/PartSet_WidgetPoint2d.cpp +++ b/src/PartSet/PartSet_WidgetPoint2d.cpp @@ -444,12 +444,12 @@ bool PartSet_WidgetPoint2D::isFeatureContainsPoint(const FeaturePtr& theFeature, std::list anAttributes = myFeature->data()->attributes(GeomDataAPI_Point2D::typeId()); std::list::iterator anIter = anAttributes.begin(); - for(; anIter != anAttributes.end(); anIter++) { + for(; anIter != anAttributes.end() && !aPointIsFound; anIter++) { AttributePoint2DPtr aPoint2DAttribute = std::dynamic_pointer_cast(*anIter); if (aPoint2DAttribute == aWidgetAttribute) continue; - if (aPoint2DAttribute.get()) { + if (aPoint2DAttribute.get() && aPoint2DAttribute->isInitialized()) { aPointIsFound = aPoint2DAttribute->pnt()->isEqual(aPnt2d); } } -- 2.39.2