From aeabffeed8f26402e278662310deac5c7cbed05e Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Sun, 25 Jan 2015 00:33:25 +0300 Subject: [PATCH] Sketcher: bugfix in updating constraints after external geometry delete --- src/Mod/Sketcher/App/SketchObject.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 7572f17a1..418ab4f0e 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -1720,7 +1720,7 @@ int SketchObject::delExternal(int ExtGeoId) int GeoId = -3 - ExtGeoId; for (std::vector::const_iterator it = constraints.begin(); it != constraints.end(); ++it) { - if ((*it)->First != GeoId && (*it)->Second != GeoId) { + if ((*it)->First != GeoId && (*it)->Second != GeoId && (*it)->Third != GeoId) { Constraint *copiedConstr = (*it)->clone(); if (copiedConstr->First < GeoId && copiedConstr->First != Constraint::GeoUndef) @@ -1728,6 +1728,10 @@ int SketchObject::delExternal(int ExtGeoId) if (copiedConstr->Second < GeoId && copiedConstr->Second != Constraint::GeoUndef) copiedConstr->Second += 1; + if (copiedConstr->Third < GeoId && + copiedConstr->Third != Constraint::GeoUndef) + copiedConstr->Third += 1; + newConstraints.push_back(copiedConstr); } }