]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2987: Restore draw rectangle state after dragging
authorvsv <vsv@opencascade.com>
Mon, 2 Sep 2019 15:36:42 +0000 (18:36 +0300)
committervsv <vsv@opencascade.com>
Mon, 2 Sep 2019 15:36:42 +0000 (18:36 +0300)
src/PartSet/PartSet_SketcherMgr.cpp

index c6e47e0b215913ca1cfb0869c7634532c72f002b..f76e254c6b761baa74904b6bec71dfeaa33047e4 100644 (file)
@@ -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<PartSet_MouseProcessor*>(anActiveWidget);