Skip to content

Commit

Permalink
Gui: Fix rotation center indicator for Gesture styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexbas authored and wwmayer committed Oct 9, 2023
1 parent b86d885 commit 908f6c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Gui/GestureNavigationStyle.cpp
Expand Up @@ -489,6 +489,7 @@ class NS::RotateState : public sc::state<NS::RotateState, NS::NaviMachine>
explicit RotateState(my_context ctx):my_base(ctx)
{
auto &ns = this->outermost_context().ns;
ns.setRotationCenter(ns.getFocalPoint());
ns.setViewingMode(NavigationStyle::DRAGGING);
this->base_pos = static_cast<const NS::Event*>(this->triggering_event())->inventor_event->getPosition();
if (ns.logging)
Expand Down Expand Up @@ -625,6 +626,7 @@ class NS::TiltState : public sc::state<NS::TiltState, NS::NaviMachine>
explicit TiltState(my_context ctx):my_base(ctx)
{
auto &ns = this->outermost_context().ns;
ns.setRotationCenter(ns.getFocalPoint());
ns.setViewingMode(NavigationStyle::DRAGGING);
this->base_pos = static_cast<const NS::Event*>(this->triggering_event())->inventor_event->getPosition();
if (ns.logging)
Expand Down
3 changes: 3 additions & 0 deletions src/Gui/MayaGestureNavigationStyle.cpp
Expand Up @@ -424,6 +424,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)

// start DRAGGING mode (orbit)
// if not pressing left mouse button then it assumes is right mouse button and starts ZOOMING mode
setRotationCenter(getFocalPoint());
setViewingMode(this->button1down ? NavigationStyle::DRAGGING : NavigationStyle::ZOOMING);
processed = true;
} else {
Expand Down Expand Up @@ -452,6 +453,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
processed = true;
} else if (type.isDerivedFrom(SoGesturePinchEvent::getClassTypeId())) {
pan(viewer->getSoRenderManager()->getCamera());//set up panning plane
setRotationCenter(getFocalPoint());
setViewingMode(NavigationStyle::DRAGGING);
processed = true;
} //all other gestures - ignore!
Expand All @@ -478,6 +480,7 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
case SoMouseButtonEvent::BUTTON3: // allows to release button3 into SELECTION mode
if(comboAfter & BUTTON1DOWN || comboAfter & BUTTON2DOWN) {
//don't leave navigation till all buttons have been released
setRotationCenter(getFocalPoint());
setViewingMode((comboAfter & BUTTON1DOWN) ? NavigationStyle::DRAGGING : NavigationStyle::PANNING);
processed = true;
} else { //all buttons are released
Expand Down

0 comments on commit 908f6c9

Please sign in to comment.