Gui: Fix Touchpad navigation style panning in edit mode
This commit is contained in:
committed by
Chris Hennes
parent
5438cc3a7f
commit
db4ab7e1f3
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user