From c33c6275a7037c61f53b5c9ce0a965ec034609bd Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 20 Nov 2017 11:08:33 +0300 Subject: [PATCH] refs #1324: patch for activation/deactivation modes on modules switch --- src/OCCViewer/OCCViewer_ViewWindow.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 5b99ac06c..c30752036 100644 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -630,8 +630,18 @@ void OCCViewer_ViewWindow::activateZoom() void OCCViewer_ViewWindow::onPanning() { - myPanningByBtn = true; - activatePanning(); + OCCViewer_ViewManager* aMgr = dynamic_cast( 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; } -- 2.39.2