Gui: Fix Blender and Revit navigation issues with shift key in sketcher

This commit is contained in:
Bas Ruigrok
2024-12-04 21:49:15 +01:00
committed by Chris Hennes
parent a7c550da98
commit 939506007d
2 changed files with 9 additions and 4 deletions

View File

@@ -197,13 +197,11 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
const auto * const event = (const SoLocation2Event *) ev;
if (this->currentmode == NavigationStyle::ZOOMING) {
this->zoomByCursor(posn, prevnormalized);
newmode = NavigationStyle::SELECTION;
processed = true;
}
else if (this->currentmode == NavigationStyle::PANNING) {
float ratio = vp.getViewportAspectRatio();
panCamera(viewer->getSoRenderManager()->getCamera(), ratio, this->panningplane, posn, prevnormalized);
newmode = NavigationStyle::SELECTION;
processed = true;
}
else if (this->currentmode == NavigationStyle::DRAGGING) {
@@ -277,6 +275,13 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
break;
default:
// Reset mode to IDLE when button 3 is released
// This stops the PANNING when button 3 is released but SHIFT is still pressed
// This stops the ZOOMING when button 3 is released but CTRL is still pressed
if ((curmode == NavigationStyle::PANNING || curmode == NavigationStyle::ZOOMING)
&& !this->button3down) {
newmode = NavigationStyle::IDLE;
}
break;
}

View File

@@ -272,12 +272,12 @@ SbBool RevitNavigationStyle::processSoEvent(const SoEvent * const ev)
break;
default:
// Reset mode to SELECTION when button 3 is released
// Reset mode to IDLE when button 3 is released
// This stops the DRAGGING when button 3 is released but SHIFT is still pressed
// This stops the ZOOMING when button 3 is released but CTRL is still pressed
if ((curmode == NavigationStyle::DRAGGING || curmode == NavigationStyle::ZOOMING)
&& !this->button3down) {
newmode = NavigationStyle::SELECTION;
newmode = NavigationStyle::IDLE;
}
break;
}