Gui: Prevent rubber-band selection when selection button is pressed after other buttons are pressed
This commit is contained in:
@@ -278,16 +278,18 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
break;
|
||||
}
|
||||
|
||||
// If the selection button is pressed together with another button
|
||||
// and the other button is released, don't switch to selection mode.
|
||||
// Process when selection button is pressed together with other buttons that could trigger different actions.
|
||||
if (this->button1down && (this->button2down || this->button3down)) {
|
||||
this->lockButton1 = true;
|
||||
processed = true;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
// If for dragging the buttons 1 and 3 are pressed
|
||||
// but then button 3 is released we shouldn't switch
|
||||
// into selection mode.
|
||||
if (this->button1down && this->button3down)
|
||||
this->lockButton1 = true;
|
||||
|
||||
// If not handled in this class, pass on upwards in the inheritance
|
||||
// hierarchy.
|
||||
if (!processed)
|
||||
|
||||
@@ -302,16 +302,18 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
break;
|
||||
}
|
||||
|
||||
// If the selection button is pressed together with another button
|
||||
// and the other button is released, don't switch to selection mode.
|
||||
// Process when selection button is pressed together with other buttons that could trigger different actions.
|
||||
if (this->button1down && (this->button2down || this->button3down)) {
|
||||
this->lockButton1 = true;
|
||||
processed = true;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
// If for dragging the buttons 1 and 3 are pressed
|
||||
// but then button 3 is released we shouldn't switch
|
||||
// into selection mode.
|
||||
if (this->button1down && this->button3down)
|
||||
this->lockButton1 = true;
|
||||
|
||||
// If not handled in this class, pass on upwards in the inheritance
|
||||
// hierarchy.
|
||||
if (!processed)
|
||||
|
||||
@@ -269,6 +269,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
}
|
||||
break;
|
||||
case BUTTON1DOWN:
|
||||
if (curmode == NavigationStyle::SELECTION) { break; }
|
||||
if (newmode != NavigationStyle::DRAGGING) {
|
||||
saveCursorPosition(ev);
|
||||
}
|
||||
@@ -295,6 +296,11 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
break;
|
||||
}
|
||||
|
||||
// Process when selection button is pressed together with other buttons that could trigger different actions.
|
||||
if (this->button1down && (this->button2down || this->button3down)) {
|
||||
processed = true;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
@@ -264,6 +264,11 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
break;
|
||||
}
|
||||
|
||||
// Process when selection button is pressed together with other buttons that could trigger different actions.
|
||||
if (this->button1down && (this->button2down || this->button3down || this->ctrldown)) {
|
||||
processed = true;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
@@ -259,6 +259,11 @@ SbBool OpenSCADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
break;
|
||||
}
|
||||
|
||||
// Process when selection button is pressed together with other buttons that could trigger different actions.
|
||||
if (this->button1down && (this->button2down || this->button3down)) {
|
||||
processed = true;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
@@ -280,16 +280,18 @@ SbBool RevitNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
break;
|
||||
}
|
||||
|
||||
// If the selection button is pressed together with another button
|
||||
// and the other button is released, don't switch to selection mode.
|
||||
// Process when selection button is pressed together with other buttons that could trigger different actions.
|
||||
if (this->button1down && (this->button2down || this->button3down)) {
|
||||
this->lockButton1 = true;
|
||||
processed = true;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
// If for dragging the buttons 1 and 3 are pressed
|
||||
// but then button 3 is released we shouldn't switch
|
||||
// into selection mode.
|
||||
if (this->button1down && this->button3down)
|
||||
this->lockButton1 = true;
|
||||
|
||||
// If not handled in this class, pass on upwards in the inheritance
|
||||
// hierarchy.
|
||||
if (!processed)
|
||||
|
||||
@@ -233,6 +233,11 @@ SbBool TinkerCADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
break;
|
||||
}
|
||||
|
||||
// Process when selection button is pressed together with other buttons that could trigger different actions.
|
||||
if (this->button1down && (this->button2down || this->button3down)) {
|
||||
processed = true;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
@@ -254,6 +254,11 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
break;
|
||||
}
|
||||
|
||||
// Process when selection button is pressed together with other buttons that could trigger different actions.
|
||||
if (this->button1down && (this->button2down || this->button3down || this->altdown)) {
|
||||
processed = true;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user