diff --git a/src/Mod/Sketcher/App/PropertyConstraintList.cpp b/src/Mod/Sketcher/App/PropertyConstraintList.cpp index 6967d7aea4..8ebc43f603 100644 --- a/src/Mod/Sketcher/App/PropertyConstraintList.cpp +++ b/src/Mod/Sketcher/App/PropertyConstraintList.cpp @@ -342,9 +342,8 @@ void PropertyConstraintList::acceptGeometry(const std::vector aboutToSetValue(); validGeometryKeys.clear(); validGeometryKeys.reserve(GeoList.size()); - for (std::vector< Part::Geometry * >::const_iterator it=GeoList.begin(); - it != GeoList.end(); ++it) - validGeometryKeys.push_back((*it)->getTypeId().getKey()); + for (const auto& it : GeoList) + validGeometryKeys.push_back((it)->getTypeId().getKey()); invalidGeometry = false; hasSetValue(); } diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 505d347523..8c9213ef47 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -5792,8 +5792,9 @@ bool SketchObject::evaluateConstraints() const return false; } - if(constraints.size()>0){ - if (!Constraints.scanGeometry(geometry)) return false; + if (!constraints.empty()) { + if (!Constraints.scanGeometry(geometry)) + return false; } return true; @@ -5802,7 +5803,7 @@ bool SketchObject::evaluateConstraints() const void SketchObject::validateConstraints() { std::vector geometry = getCompleteGeometry(); - const std::vector& constraints = Constraints.getValues(); + const std::vector& constraints = Constraints.getValuesForce(); std::vector newConstraints; std::vector::const_iterator it; @@ -5816,6 +5817,9 @@ void SketchObject::validateConstraints() Constraints.setValues(newConstraints); acceptGeometry(); } + else if (!Constraints.scanGeometry(geometry)) { + Constraints.acceptGeometry(geometry); + } } std::string SketchObject::validateExpression(const App::ObjectIdentifier &path, boost::shared_ptr expr)