diff --git a/src/Gui/NavigationStyle.h b/src/Gui/NavigationStyle.h index 1ed0bafcaf..ea8582055e 100644 --- a/src/Gui/NavigationStyle.h +++ b/src/Gui/NavigationStyle.h @@ -415,6 +415,9 @@ public: protected: SbBool processSoEvent(const SoEvent * const ev) override; + +private: + SbBool blockPan {false}; // Used to block the first pan in a mouse movement to prevent big jumps }; class GuiExport OpenCascadeNavigationStyle : public UserNavigationStyle { diff --git a/src/Gui/TouchpadNavigationStyle.cpp b/src/Gui/TouchpadNavigationStyle.cpp index 5400440ae5..6efa6dc9a3 100644 --- a/src/Gui/TouchpadNavigationStyle.cpp +++ b/src/Gui/TouchpadNavigationStyle.cpp @@ -176,8 +176,11 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) processed = true; } else if (this->currentmode == NavigationStyle::PANNING) { - float ratio = vp.getViewportAspectRatio(); - panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized); + if (!blockPan) { + float ratio = vp.getViewportAspectRatio(); + panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized); + } + blockPan = false; processed = true; } else if (this->currentmode == NavigationStyle::DRAGGING) { @@ -233,6 +236,10 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) processed = true; } newmode = NavigationStyle::PANNING; + + if (currentmode != NavigationStyle::PANNING) { + blockPan = true; + } break; case ALTDOWN: if (newmode != NavigationStyle::DRAGGING) {