From 776cfe62edc085389079a3440f23e24ce1fb60c7 Mon Sep 17 00:00:00 2001 From: Mattis Date: Tue, 3 Oct 2017 21:58:33 +0200 Subject: [PATCH] added selection of end-points to line touch-select --- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index d6715c50dc..3d43c15577 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -1934,6 +1934,7 @@ void ViewProviderSketch::doBoxSelection(const SbVec2s &startPos, const SbVec2s & int VertexId = -1; // the loop below should be in sync with the main loop in ViewProviderSketch::draw // so that the vertex indices are calculated correctly int GeoId = 0; + bool touchMode = false; //check if selection goes from the right to the left side (for touch-selection where even partially boxed objects get selected) if(corners[0].getValue()[0] > corners[1].getValue()[0]) @@ -1985,6 +1986,12 @@ void ViewProviderSketch::doBoxSelection(const SbVec2s &startPos, const SbVec2s & std::stringstream ss; ss << "Edge" << GeoId + 1; Gui::Selection().addSelection(doc->getName(), sketchObject->getNameInDocument(), ss.str().c_str()); + } else + //check if line intersects with (boundbox of) polygon + if(touchMode && polygon.CalcBoundBox().Intersect(Base::Line2d(Base::Vector2d(pnt1.x, pnt1.y), Base::Vector2d(pnt2.x, pnt2.y))) ){ + std::stringstream ss; + ss << "Edge" << GeoId + 1; + Gui::Selection().addSelection(doc->getName(), sketchObject->getNameInDocument(), ss.str().c_str()); } } else if ((*it)->getTypeId() == Part::GeomCircle::getClassTypeId()) {