]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
refs #1324: patch for activation/deactivation modes on modules switch v2.1
authorasl <asl@opencascade.com>
Mon, 20 Nov 2017 08:08:33 +0000 (11:08 +0300)
committerasl <asl@opencascade.com>
Mon, 20 Nov 2017 08:08:33 +0000 (11:08 +0300)
src/OCCViewer/OCCViewer_ViewWindow.cxx

index 5b99ac06c1a6ebf6b5d316fd7b6261bafb07748f..c307520368c9ef663a76f40b6a1af678fe6e65c6 100644 (file)
@@ -630,8 +630,18 @@ void OCCViewer_ViewWindow::activateZoom()
 
 void OCCViewer_ViewWindow::onPanning()
 {
-  myPanningByBtn = true;
-  activatePanning();
+  OCCViewer_ViewManager* aMgr = dynamic_cast<OCCViewer_ViewManager*>( getViewManager() );
+  bool isChained = aMgr->isChainedOperations();
+  bool isReset = ( myPanningByBtn && isChained );
+  if( isReset )
+  {
+    resetState();
+  }
+  else
+  {
+    myPanningByBtn = true;
+    activatePanning();
+  }
 }
 
 /*!
@@ -1230,6 +1240,8 @@ void OCCViewer_ViewWindow::resetState()
 
   setTransformInProcess( false );
   setTransformRequested( NOTHING );
+
+  myPanningByBtn = false;
 }