Salome HOME
refs #30 - Sketch base GUI: create, draw lines
[modules/shaper.git] / src / XGUI / XGUI_Viewer.cpp
index 78d9d841ccd01c6ba2f8407fc096e46d36e14e44..734a1a469e48ab9ff6bbed1d29a8302e6c63ab13 100644 (file)
@@ -532,6 +532,11 @@ void XGUI_Viewer::onMouseReleased(XGUI_ViewWindow* theWindow, QMouseEvent* theEv
   //  emit deselection();
 
   if (myStartPnt == myEndPnt) {
+    // the MoveTo is necessary for the second click in the same point. Otherwise the selection is lost.
+    Handle(V3d_View) aView3d = theWindow->viewPort()->getView();
+    if ( !aView3d.IsNull() ) {
+      myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView3d);
+    }
     if (aHasShift && myMultiSelectionEnabled)
       myAISContext->ShiftSelect();
     else