diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 8d5a743fb..a2923f4e6 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -1553,6 +1553,7 @@ bool ViewProviderSketch::detectPreselection(const SoPickedPoint *Point, assert(edit); int PtIndex = -1; + int EdgeIndex = -1; int GeoIndex = -1; // valid values are 0,1,2,... for normal geometry and -3,-4,-5,... for external geometry int CrossIndex = -1; std::set constrIndices; @@ -1579,8 +1580,9 @@ bool ViewProviderSketch::detectPreselection(const SoPickedPoint *Point, const SoDetail *curve_detail = Point->getDetail(edit->CurveSet); if (curve_detail && curve_detail->getTypeId() == SoLineDetail::getClassTypeId()) { // get the index - int CurvIndex = static_cast(curve_detail)->getLineIndex(); - GeoIndex = edit->CurvIdToGeoId[CurvIndex]; + int curveIndex = static_cast(curve_detail)->getLineIndex(); + GeoIndex = edit->CurvIdToGeoId[curveIndex]; + EdgeIndex = curveIndex; } // checking for a hit in the cross } else if (tail == edit->RootCrossSet) { @@ -1619,7 +1621,7 @@ bool ViewProviderSketch::detectPreselection(const SoPickedPoint *Point, } else if (GeoIndex != -1 && GeoIndex != edit->PreselectCurve) { // if a new curve is hit std::stringstream ss; if (GeoIndex >= 0) - ss << "Edge" << GeoIndex + 1; + ss << "Edge" << EdgeIndex + 1; else // external geometry ss << "ExternalEdge" << -GeoIndex - 2; // convert index start from -3 to 1 bool accepted =