Gui: Prohibit interrupting a rubber-band selection in sketcher

This commit is contained in:
Rexbas
2024-01-24 20:54:00 +01:00
parent eac036105e
commit 7fbd53f003
9 changed files with 87 additions and 13 deletions

View File

@@ -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);
}