Sketcher: fix crashes on geometry deletion in sketches with symmetry constraints

This commit is contained in:
logari81
2012-07-18 13:23:38 +02:00
parent d74863e812
commit 33cc47db95

View File

@@ -336,12 +336,14 @@ int SketchObject::delGeometry(int GeoId)
std::vector< Constraint * > newConstraints(0);
for (std::vector<Constraint *>::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 -= 1;
if (copiedConstr->Second > GeoId)
copiedConstr->Second -= 1;
if (copiedConstr->Third > GeoId)
copiedConstr->Third -= 1;
newConstraints.push_back(copiedConstr);
}
}