From 4cec87c8b2a490943572037a543ea65b4c5d8e89 Mon Sep 17 00:00:00 2001 From: vsv Date: Sat, 27 Dec 2014 12:12:49 +0300 Subject: [PATCH] Improvement for lines editing by dragging --- src/PartSet/PartSet_SketcherMgr.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 00688b9b8..f9c1eb3fd 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -125,6 +125,11 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE aOperation->abort(); return; } + + // MoveTo in order to highlight current object + ModuleBase_IViewer* aViewer = aWorkshop->viewer(); + aViewer->AISContext()->MoveTo(theEvent->x(), theEvent->y(), theWnd->v3dView()); + // Remember highlighted objects for editing ModuleBase_ISelection* aSelect = aWorkshop->selection(); QList aHighlighted = aSelect->getHighlighted(); @@ -186,8 +191,8 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE launchEditing(); } else if (isSketchOpe && isEditing) { - // If selected another object - aOperation->abort(); + // If selected another object commit current result + aOperation->commit(); myIsDragging = true; get2dPoint(theWnd, theEvent, myCurX, myCurY); @@ -216,7 +221,7 @@ void PartSet_SketcherMgr::onMouseReleased(ModuleBase_IViewWindow* theWnd, QMouse myIsDragging = false; if (myDragDone) { aViewer->enableMultiselection(true); - aOp->commit(); + //aOp->commit(); myEditingFeatures.clear(); myEditingAttr.clear(); -- 2.39.2