From: vsv Date: Mon, 2 Sep 2019 15:36:42 +0000 (+0300) Subject: Issue #2987: Restore draw rectangle state after dragging X-Git-Tag: VEDF2019Lot4~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a6109aa0cebae84f632acd2e63a1f7a9cf73d81e;p=modules%2Fshaper.git Issue #2987: Restore draw rectangle state after dragging --- diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index c6e47e0b2..f76e254c6 100644 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -459,6 +459,10 @@ void PartSet_SketcherMgr::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseE void PartSet_SketcherMgr::onMouseReleased(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent) { + ModuleBase_IWorkshop* aWorkshop = myModule->workshop(); + if (myIsDragging) + aWorkshop->viewer()->enableDrawMode(myPreviousDrawModeEnabled); + bool aWasDragging = myIsDragging; myIsDragging = false; @@ -469,7 +473,6 @@ void PartSet_SketcherMgr::onMouseReleased(ModuleBase_IViewWindow* theWnd, QMouse if (!myIsMouseOverViewProcessed) return; - ModuleBase_IWorkshop* aWorkshop = myModule->workshop(); ModuleBase_IViewer* aViewer = aWorkshop->viewer(); if (!aViewer->canDragByMouse()) return; @@ -489,7 +492,6 @@ void PartSet_SketcherMgr::onMouseReleased(ModuleBase_IViewWindow* theWnd, QMouse } } - aWorkshop->viewer()->enableDrawMode(myPreviousDrawModeEnabled); ModuleBase_ModelWidget* anActiveWidget = getActiveWidget(); PartSet_MouseProcessor* aProcessor = dynamic_cast(anActiveWidget);