From 30160841dd2a8bfef3b4588325b8c0fc217bac26 Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 16 May 2014 18:30:59 +0400 Subject: [PATCH] refs #30 - Sketch base GUI: create, draw lines The selection is lost by second click in the same point The scenario is: Click sketch feature, click line feature, create line, select created line by click in a point - it is selected, select the same point secondly - the selection disappears --- src/XGUI/XGUI_Viewer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/XGUI/XGUI_Viewer.cpp b/src/XGUI/XGUI_Viewer.cpp index 78d9d841c..734a1a469 100644 --- a/src/XGUI/XGUI_Viewer.cpp +++ b/src/XGUI/XGUI_Viewer.cpp @@ -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 -- 2.39.2