From 5d17586dcd4742b87675b3bc5dda51aad9aa54b6 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 3 Nov 2011 12:23:33 +0000 Subject: [PATCH] + do not call seekToPoint() but directly panToCenter() for middle-clicks git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5087 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- src/Gui/BlenderNavigationStyle.cpp | 5 +---- src/Gui/CADNavigationStyle.cpp | 10 ++-------- src/Gui/InventorNavigationStyle.cpp | 15 ++++++--------- 3 files changed, 9 insertions(+), 21 deletions(-) diff --git a/src/Gui/BlenderNavigationStyle.cpp b/src/Gui/BlenderNavigationStyle.cpp index c35566c64..5a2eb76c5 100644 --- a/src/Gui/BlenderNavigationStyle.cpp +++ b/src/Gui/BlenderNavigationStyle.cpp @@ -247,10 +247,7 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) float dci = (float)QApplication::doubleClickInterval()/1000.0f; // is it just a middle click? if (tmp.getValue() < dci && !this->lockrecenter) { - if (!this->seekToPoint(pos)) { - panToCenter(panningplane, posn); - this->interactiveCountDec(); - } + panToCenter(panningplane, posn); processed = TRUE; } } diff --git a/src/Gui/CADNavigationStyle.cpp b/src/Gui/CADNavigationStyle.cpp index c85c2f743..c75481f22 100644 --- a/src/Gui/CADNavigationStyle.cpp +++ b/src/Gui/CADNavigationStyle.cpp @@ -189,10 +189,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) float dci = (float)QApplication::doubleClickInterval()/1000.0f; // is it just a left click? if (tmp.getValue() < dci && !this->lockrecenter) { - if (!this->seekToPoint(pos)) { - panToCenter(panningplane, posn); - this->interactiveCountDec(); - } + panToCenter(panningplane, posn); processed = TRUE; } } @@ -276,10 +273,7 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev) float dci = (float)QApplication::doubleClickInterval()/1000.0f; // is it just a middle click? if (tmp.getValue() < dci && !this->lockrecenter) { - if (!this->seekToPoint(pos)) { - panToCenter(panningplane, posn); - this->interactiveCountDec(); - } + panToCenter(panningplane, posn); processed = TRUE; } } diff --git a/src/Gui/InventorNavigationStyle.cpp b/src/Gui/InventorNavigationStyle.cpp index 943312cec..9c40edc4e 100644 --- a/src/Gui/InventorNavigationStyle.cpp +++ b/src/Gui/InventorNavigationStyle.cpp @@ -182,10 +182,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) float dci = (float)QApplication::doubleClickInterval()/1000.0f; // is it just a left click? if (tmp.getValue() < dci && !this->lockrecenter) { - if (!this->seekToPoint(pos)) { - panToCenter(panningplane, posn); - this->interactiveCountDec(); - } + panToCenter(panningplane, posn); processed = TRUE; } } @@ -193,19 +190,22 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) newmode = NavigationStyle::SEEK_MODE; this->seekToPoint(pos); // implicitly calls interactiveCountInc() processed = TRUE; + this->lockrecenter = TRUE; } else if (press && (this->currentmode == NavigationStyle::IDLE)) { this->setViewing(true); processed = TRUE; + this->lockrecenter = TRUE; } else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) { this->setViewing(false); processed = TRUE; + this->lockrecenter = TRUE; } else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) { processed = TRUE; + this->lockrecenter = TRUE; } - this->lockrecenter = TRUE; break; case SoMouseButtonEvent::BUTTON2: // If we are in edit mode then simply ignore the RMB events @@ -237,10 +237,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) float dci = (float)QApplication::doubleClickInterval()/1000.0f; // is it just a middle click? if (tmp.getValue() < dci && !this->lockrecenter) { - if (!this->seekToPoint(pos)) { - panToCenter(panningplane, posn); - this->interactiveCountDec(); - } + panToCenter(panningplane, posn); processed = TRUE; } }