[Bugfix]Sketcher: prevent dangling state of Shift key if key released out of Quarter

This commit is contained in:
0penBrain
2022-09-01 17:24:13 +02:00
committed by Chris Hennes
parent 1059dd4f9f
commit b76da40885

View File

@@ -511,12 +511,6 @@ bool ViewProviderSketch::keyPressed(bool pressed, int key)
return false;
}
break;
case SoKeyboardEvent::LEFT_SHIFT:
if (Mode < STATUS_SKETCH_UseHandler) {
editCoinManager->setConstraintSelectability(!pressed);
return true;
}
[[fallthrough]];
default:
{
if (isInEditMode() && sketchHandler)
@@ -1081,6 +1075,16 @@ bool ViewProviderSketch::mouseMove(const SbVec2s &cursorPos, Gui::View3DInventor
// maximum radius for mouse moves when selecting a geometry before switching to drag mode
const int dragIgnoredDistance = 3;
static bool selectableConstraints = true;
if (Mode < STATUS_SKETCH_UseHandler) {
bool tmpSelCons = QApplication::keyboardModifiers() & Qt::ShiftModifier;
if (tmpSelCons != !selectableConstraints) {
selectableConstraints = !tmpSelCons;
editCoinManager->setConstraintSelectability(selectableConstraints);
}
}
if (!isInEditMode())
return false;