]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Local selection was broken after rotation due to incorrect myPoint and myOtherPoint...
authorsan <san@opencascade.com>
Sat, 21 Feb 2009 10:35:52 +0000 (10:35 +0000)
committersan <san@opencascade.com>
Sat, 21 Feb 2009 10:35:52 +0000 (10:35 +0000)
src/SVTK/SVTK_InteractorStyle.cxx

index 56e56467b53a7b138f1957a4aa32f3b16c2ea54e..199c3729d8acef2d012cd9ccc5ff58568b2974c0 100644 (file)
@@ -555,16 +555,24 @@ void
 SVTK_InteractorStyle
 ::OnLeftButtonUp(int vtkNotUsed(ctrl),
                 int shift, 
-                int vtkNotUsed(x),
-                int vtkNotUsed(y))
-{
+                int x,
+                int y)
+{
+  // san (21.02.2009): State == VTK_INTERACTOR_STYLE_CAMERA_NONE when the left button is released
+  // and single selection is enabled means a selection event
+  if ( State == VTK_INTERACTOR_STYLE_CAMERA_NONE ) {
+    if ( isSelectionEnabled() && !isMultiSelectionEnabled() ) {
+      myOtherPoint = myPoint = QPoint(x, y);
+      startOperation(VTK_INTERACTOR_STYLE_CAMERA_SELECT);
+    }
+  }
+
   myShiftState = shift;
   // finishing current viewer operation
-  // san (20.02.2009): State == VTK_INTERACTOR_STYLE_CAMERA_NONE is also processed
-  // by onFinishOperation(), it might mean that the left button was pressed when
-  // no multi-selection is allowed
-  onFinishOperation();
-  startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
+  if (State != VTK_INTERACTOR_STYLE_CAMERA_NONE) {
+    onFinishOperation();
+    startOperation(VTK_INTERACTOR_STYLE_CAMERA_NONE);
+  }
 }
 
 /*!
@@ -1053,11 +1061,6 @@ SVTK_InteractorStyle
   SVTK_SelectionEvent* aSelectionEvent = GetSelectionEventFlipY();
 
   switch (State) {
-    case VTK_INTERACTOR_STYLE_CAMERA_NONE:
-      // san (19.02.2009): If we are here, and single selection is enabled,
-      // then we should process the mouse click - and break otherwise
-      if ( !isSelectionEnabled() || isMultiSelectionEnabled() )
-        break;
     case VTK_INTERACTOR_STYLE_CAMERA_SELECT:
     case VTK_INTERACTOR_STYLE_CAMERA_FIT:
     {