Gui: Fix selection in Blender, CAD and Revit style

This commit is contained in:
Bas Ruigrok
2024-02-24 14:04:21 +01:00
committed by Chris Hennes
parent 1e487c3346
commit 45e33a7f12
3 changed files with 18 additions and 3 deletions

View File

@@ -131,6 +131,9 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
this->centerTime = ev->getTime();
processed = true;
}
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
processed = true;
}
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
processed = true;
}
@@ -245,12 +248,15 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev)
// The left mouse button has been released right now
if (this->lockButton1) {
this->lockButton1 = false;
if (curmode != NavigationStyle::SELECTION) {
processed = true;
}
}
break;
case BUTTON1DOWN:
case CTRLDOWN|BUTTON1DOWN:
// make sure not to change the selection when stopping spinning
if (!viewer->isEditing() && (curmode == NavigationStyle::SPINNING || this->lockButton1))
if (curmode == NavigationStyle::SPINNING || this->lockButton1 && curmode != NavigationStyle::SELECTION)
newmode = NavigationStyle::IDLE;
else
newmode = NavigationStyle::SELECTION;

View File

@@ -253,11 +253,14 @@ SbBool CADNavigationStyle::processSoEvent(const SoEvent * const ev)
// The left mouse button has been released right now
if (this->lockButton1) {
this->lockButton1 = false;
if (curmode != NavigationStyle::SELECTION) {
processed = true;
}
}
break;
case BUTTON1DOWN:
// make sure not to change the selection when stopping spinning
if (!viewer->isEditing() && (curmode == NavigationStyle::SPINNING || this->lockButton1))
if (curmode == NavigationStyle::SPINNING || this->lockButton1 && curmode != NavigationStyle::SELECTION)
newmode = NavigationStyle::IDLE;
else
newmode = NavigationStyle::SELECTION;

View File

@@ -130,6 +130,9 @@ SbBool RevitNavigationStyle::processSoEvent(const SoEvent * const ev)
this->centerTime = ev->getTime();
processed = true;
}
else if (!press && (this->currentmode == NavigationStyle::DRAGGING)) {
processed = true;
}
else if (viewer->isEditing() && (this->currentmode == NavigationStyle::SPINNING)) {
processed = true;
}
@@ -242,12 +245,15 @@ SbBool RevitNavigationStyle::processSoEvent(const SoEvent * const ev)
// The left mouse button has been released right now
if (this->lockButton1) {
this->lockButton1 = false;
if (curmode != NavigationStyle::SELECTION) {
processed = true;
}
}
break;
case BUTTON1DOWN:
case CTRLDOWN|BUTTON1DOWN:
// make sure not to change the selection when stopping spinning
if (!viewer->isEditing() && (curmode == NavigationStyle::SPINNING || this->lockButton1))
if (curmode == NavigationStyle::SPINNING || this->lockButton1 && curmode != NavigationStyle::SELECTION)
newmode = NavigationStyle::IDLE;
else
newmode = NavigationStyle::SELECTION;