From 4a680d12b72b00d28e6cb66f266dcbb1dfd9800c Mon Sep 17 00:00:00 2001 From: logari81 Date: Sat, 8 Dec 2012 23:48:35 +0100 Subject: [PATCH] Sketcher: Fix deletion of coincident constraints on the root point --- src/Mod/Sketcher/App/SketchObject.cpp | 6 +++++- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 2d208284cc..78a76007ba 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -410,7 +410,11 @@ int SketchObject::delConstraintOnPoint(int VertexId, bool onlyCoincident) { int GeoId; PointPos PosId; - getGeoVertexIndex(VertexId, GeoId, PosId); + if (VertexId == -1) { // RootPoint + GeoId = -1; + PosId = start; + } else + getGeoVertexIndex(VertexId, GeoId, PosId); return delConstraintOnPoint(GeoId, PosId, onlyCoincident); } diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 2beb574b2b..8e625ab763 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -3349,6 +3349,8 @@ bool ViewProviderSketch::onDelete(const std::vector &subList) delGeometries.insert(GeoId); else delCoincidents.insert(VtId); + } else if (*it == "RootPoint") { + delCoincidents.insert(-1); } else if (it->size() > 10 && it->substr(0,10) == "Constraint") { int ConstrId = std::atoi(it->substr(10,4000).c_str()); delConstraints.insert(ConstrId);