Gui: Reset navigation flags when the new mode is not IDLE or when the mouse buttons are released
This commit is contained in:
committed by
Chris Hennes
parent
98e653fc9f
commit
7fa5147043
@@ -1591,6 +1591,14 @@ void NavigationStyle::syncModifierKeys(const SoEvent * const ev)
|
||||
void NavigationStyle::setViewingMode(const ViewerMode newmode)
|
||||
{
|
||||
const ViewerMode oldmode = this->currentmode;
|
||||
|
||||
// Reset flags when changing from IDLE to another mode or if the mode is IDLE and the buttons are released
|
||||
if ((oldmode == IDLE && newmode != IDLE) || (newmode == IDLE && !button1down && !button2down && !button3down)) {
|
||||
hasPanned = false;
|
||||
hasDragged = false;
|
||||
hasZoomed = false;
|
||||
}
|
||||
|
||||
if (newmode == oldmode) {
|
||||
|
||||
// The rotation center could have been changed even if the mode has not changed
|
||||
@@ -1601,12 +1609,6 @@ void NavigationStyle::setViewingMode(const ViewerMode newmode)
|
||||
return;
|
||||
}
|
||||
|
||||
if (newmode == NavigationStyle::IDLE) {
|
||||
hasPanned = false;
|
||||
hasDragged = false;
|
||||
hasZoomed = false;
|
||||
}
|
||||
|
||||
switch (newmode) {
|
||||
case DRAGGING:
|
||||
// Set up initial projection point for the projector object when
|
||||
|
||||
Reference in New Issue
Block a user