]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Increasing the sensitivity of selection to 10 pixels.
authornds <natalia.donis@opencascade.com>
Fri, 23 May 2014 04:52:13 +0000 (08:52 +0400)
committernds <natalia.donis@opencascade.com>
Fri, 23 May 2014 04:52:13 +0000 (08:52 +0400)
src/XGUI/XGUI_Displayer.cpp

index 4073b30b435838c86319ab4286eb1c3e558488b9..3eb66b044ede7782de3871109ce49c41496cde64 100644 (file)
@@ -20,6 +20,8 @@
 
 #include <set>
 
+const int MOUSE_SENSITIVITY_IN_PIXEL = 10; ///< defines the local context mouse selection sensitivity
+
 XGUI_Displayer::XGUI_Displayer(XGUI_Workshop* theWorkshop)
 {
   myWorkshop = theWorkshop;
@@ -119,6 +121,9 @@ void XGUI_Displayer::Redisplay(boost::shared_ptr<ModelAPI_Feature> theFeature,
   if (!aContext->HasOpenedContext()) {
     aContext->ClearCurrents(false);
     aContext->OpenLocalContext(false/*use displayed objects*/, true/*allow shape decomposition*/);
+    // set mouse sensitivity
+    aContext->SetSensitivityMode(StdSelect_SM_WINDOW);
+    aContext->SetPixelTolerance(MOUSE_SENSITIVITY_IN_PIXEL);
   }
   // display or redisplay presentation
   Handle(AIS_Shape) anAIS;