From 430718764290da9456f5afc1c904d949930dcfae Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 16 Jun 2016 19:09:49 +0300 Subject: [PATCH] Fix for constraints selection --- src/XGUI/XGUI_Displayer.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 091cd446c..83e738a05 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -903,14 +903,15 @@ void XGUI_Displayer::activateAIS(const Handle(AIS_InteractiveObject)& theIO, aContext->Activate(theIO, theMode, false); // the fix from VPA for more suitable selection of sketcher lines - double aPrecision = theIO->Width() + 2; - if (theMode == getSelectionMode(TopAbs_VERTEX)) - aPrecision = ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", "point-selection-sensitivity", 20); - else if ((theMode == getSelectionMode(TopAbs_EDGE)) || (theMode == getSelectionMode(TopAbs_WIRE))) - aPrecision = theIO->Width() + - ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", "edge-selection-sensitivity", 2); - aContext->SetSelectionSensitivity(theIO, theMode, aPrecision); - + if (theIO->Width() > 1) { + double aPrecision = theIO->Width() + 2; + if (theMode == getSelectionMode(TopAbs_VERTEX)) + aPrecision = ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", "point-selection-sensitivity", 20); + else if ((theMode == getSelectionMode(TopAbs_EDGE)) || (theMode == getSelectionMode(TopAbs_WIRE))) + aPrecision = theIO->Width() + + ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", "edge-selection-sensitivity", 2); + aContext->SetSelectionSensitivity(theIO, theMode, aPrecision); + } ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::activateAIS -- Activate"); #ifdef DEBUG_ACTIVATE_AIS -- 2.39.2