Gui: Prohibit interrupting a rubber-band selection in sketcher
This commit is contained in:
@@ -242,17 +242,15 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
case 0:
|
||||
if (curmode == NavigationStyle::SPINNING) { break; }
|
||||
newmode = NavigationStyle::IDLE;
|
||||
// The left mouse button has been released right now but
|
||||
// we want to avoid that the event is processed elsewhere
|
||||
// The left mouse button has been released right now
|
||||
if (this->lockButton1) {
|
||||
this->lockButton1 = false;
|
||||
processed = true;
|
||||
}
|
||||
break;
|
||||
case BUTTON1DOWN:
|
||||
case CTRLDOWN|BUTTON1DOWN:
|
||||
// make sure not to change the selection when stopping spinning
|
||||
if (curmode == NavigationStyle::SPINNING || this->lockButton1)
|
||||
if (!viewer->isEditing() && (curmode == NavigationStyle::SPINNING || this->lockButton1))
|
||||
newmode = NavigationStyle::IDLE;
|
||||
else
|
||||
newmode = NavigationStyle::SELECTION;
|
||||
@@ -286,6 +284,12 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
processed = true;
|
||||
}
|
||||
|
||||
// Prevent interrupting rubber-band selection in sketcher
|
||||
if (viewer->isEditing() && curmode == NavigationStyle::SELECTION && newmode != NavigationStyle::IDLE) {
|
||||
newmode = NavigationStyle::SELECTION;
|
||||
processed = false;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
@@ -250,16 +250,14 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
case 0:
|
||||
if (curmode == NavigationStyle::SPINNING) { break; }
|
||||
newmode = NavigationStyle::IDLE;
|
||||
// The left mouse button has been released right now but
|
||||
// we want to avoid that the event is processed elsewhere
|
||||
// The left mouse button has been released right now
|
||||
if (this->lockButton1) {
|
||||
this->lockButton1 = false;
|
||||
processed = true;
|
||||
}
|
||||
break;
|
||||
case BUTTON1DOWN:
|
||||
// make sure not to change the selection when stopping spinning
|
||||
if (curmode == NavigationStyle::SPINNING || this->lockButton1)
|
||||
if (!viewer->isEditing() && (curmode == NavigationStyle::SPINNING || this->lockButton1))
|
||||
newmode = NavigationStyle::IDLE;
|
||||
else
|
||||
newmode = NavigationStyle::SELECTION;
|
||||
@@ -310,6 +308,12 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
processed = true;
|
||||
}
|
||||
|
||||
// Prevent interrupting rubber-band selection in sketcher
|
||||
if (viewer->isEditing() && curmode == NavigationStyle::SELECTION && newmode != NavigationStyle::IDLE) {
|
||||
newmode = NavigationStyle::SELECTION;
|
||||
processed = false;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
@@ -301,6 +301,12 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
processed = true;
|
||||
}
|
||||
|
||||
// Prevent interrupting rubber-band selection in sketcher
|
||||
if (viewer->isEditing() && curmode == NavigationStyle::SELECTION && newmode != NavigationStyle::IDLE) {
|
||||
newmode = NavigationStyle::SELECTION;
|
||||
processed = false;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
@@ -308,8 +308,40 @@ SbBool MayaGestureNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
|
||||
//all mode-dependent stuff is within this switch.
|
||||
switch(curmode){
|
||||
case NavigationStyle::IDLE:
|
||||
case NavigationStyle::SELECTION:
|
||||
// Prevent interrupting rubber-band selection in sketcher
|
||||
if (viewer->isEditing()) {
|
||||
if (evIsButton) {
|
||||
auto const event = (const SoMouseButtonEvent*)ev;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN;
|
||||
const int button = event->getButton();
|
||||
|
||||
if (!press && button == SoMouseButtonEvent::BUTTON1) {
|
||||
setViewingMode(NavigationStyle::IDLE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (this->button1down) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
[[fallthrough]];
|
||||
case NavigationStyle::IDLE:
|
||||
// Prevent interrupting rubber-band selection in sketcher
|
||||
if (viewer->isEditing()) {
|
||||
if (evIsButton) {
|
||||
auto const event = (const SoMouseButtonEvent*)ev;
|
||||
const SbBool press = event->getState() == SoButtonEvent::DOWN;
|
||||
const int button = event->getButton();
|
||||
|
||||
if (press && button == SoMouseButtonEvent::BUTTON1 && !this->altdown) {
|
||||
setViewingMode(NavigationStyle::SELECTION);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
[[fallthrough]];
|
||||
case NavigationStyle::INTERACT: {
|
||||
//idle and interaction
|
||||
|
||||
|
||||
@@ -269,6 +269,12 @@ SbBool OpenCascadeNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
processed = true;
|
||||
}
|
||||
|
||||
// Prevent interrupting rubber-band selection in sketcher
|
||||
if (viewer->isEditing() && curmode == NavigationStyle::SELECTION && newmode != NavigationStyle::IDLE) {
|
||||
newmode = NavigationStyle::SELECTION;
|
||||
processed = false;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
@@ -264,6 +264,12 @@ SbBool OpenSCADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
processed = true;
|
||||
}
|
||||
|
||||
// Prevent interrupting rubber-band selection in sketcher
|
||||
if (viewer->isEditing() && curmode == NavigationStyle::SELECTION && newmode != NavigationStyle::IDLE) {
|
||||
newmode = NavigationStyle::SELECTION;
|
||||
processed = false;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
@@ -239,17 +239,15 @@ SbBool RevitNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
case 0:
|
||||
if (curmode == NavigationStyle::SPINNING) { break; }
|
||||
newmode = NavigationStyle::IDLE;
|
||||
// The left mouse button has been released right now but
|
||||
// we want to avoid that the event is processed elsewhere
|
||||
// The left mouse button has been released right now
|
||||
if (this->lockButton1) {
|
||||
this->lockButton1 = false;
|
||||
processed = true;
|
||||
}
|
||||
break;
|
||||
case BUTTON1DOWN:
|
||||
case CTRLDOWN|BUTTON1DOWN:
|
||||
// make sure not to change the selection when stopping spinning
|
||||
if (curmode == NavigationStyle::SPINNING || this->lockButton1)
|
||||
if (!viewer->isEditing() && (curmode == NavigationStyle::SPINNING || this->lockButton1))
|
||||
newmode = NavigationStyle::IDLE;
|
||||
else
|
||||
newmode = NavigationStyle::SELECTION;
|
||||
@@ -288,6 +286,12 @@ SbBool RevitNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
processed = true;
|
||||
}
|
||||
|
||||
// Prevent interrupting rubber-band selection in sketcher
|
||||
if (viewer->isEditing() && curmode == NavigationStyle::SELECTION && newmode != NavigationStyle::IDLE) {
|
||||
newmode = NavigationStyle::SELECTION;
|
||||
processed = false;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
@@ -238,6 +238,12 @@ SbBool TinkerCADNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
processed = true;
|
||||
}
|
||||
|
||||
// Prevent interrupting rubber-band selection in sketcher
|
||||
if (viewer->isEditing() && curmode == NavigationStyle::SELECTION && newmode != NavigationStyle::IDLE) {
|
||||
newmode = NavigationStyle::SELECTION;
|
||||
processed = false;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
@@ -259,6 +259,12 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev)
|
||||
processed = true;
|
||||
}
|
||||
|
||||
// Prevent interrupting rubber-band selection in sketcher
|
||||
if (viewer->isEditing() && curmode == NavigationStyle::SELECTION && newmode != NavigationStyle::IDLE) {
|
||||
newmode = NavigationStyle::SELECTION;
|
||||
processed = false;
|
||||
}
|
||||
|
||||
if (newmode != curmode) {
|
||||
this->setViewingMode(newmode);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user