]> OCCT Git - occt.git/commitdiff
0033513: Zooming - Only working when mouse move horizontally
authorcarlosah <carlos.hernandez@opencascade.com>
Tue, 24 Oct 2023 14:20:10 +0000 (14:20 +0000)
committercarlosah <carlos.hernandez@opencascade.com>
Tue, 24 Oct 2023 14:20:10 +0000 (14:20 +0000)
src/AIS/AIS_MouseGesture.hxx
src/AIS/AIS_ViewController.cxx

index b972e84451eaf14db54b402492b5ae7096508a52..c74da650a1c21d6958e5897f8b99a52ac9ed63cb 100644 (file)
@@ -29,6 +29,7 @@ enum AIS_MouseGesture
   //
   AIS_MouseGesture_Zoom,            //!< view zoom gesture;
                                     //!  move mouse left to zoom-out, and to the right to zoom-in
+  AIS_MouseGesture_ZoomVertical,    //!< view zoom vertical;
   AIS_MouseGesture_ZoomWindow,      //!< view zoom by window gesture;
                                     //!  press button to start, move mouse to define rectangle, release to finish
   AIS_MouseGesture_Pan,             //!< view panning gesture
index 12ad1ef6176b46552a5b45363116d97fab8ed42f..0eed999d9bdbef0ecdf0be776ef1b3a96aeb16f9 100644 (file)
@@ -838,6 +838,7 @@ bool AIS_ViewController::UpdateMouseButtons (const Graphic3d_Vec2i& thePoint,
         }
         case AIS_MouseGesture_Zoom:
         case AIS_MouseGesture_ZoomWindow:
+        case AIS_MouseGesture_ZoomVertical:
         {
           if (!myToAllowZooming)
           {
@@ -1055,6 +1056,25 @@ bool AIS_ViewController::UpdateMousePosition (const Graphic3d_Vec2i& thePoint,
       }
       break;
     }
+    case AIS_MouseGesture_ZoomVertical:
+    {
+      if (!myToAllowZooming)
+      {
+        break;
+      }
+      const double aZoomTol = theIsEmulated
+                            ? double(myTouchToleranceScale) * myTouchZoomThresholdPx
+                            : 0.0;
+      if (double (Abs (aDelta.y())) > aZoomTol)
+      {
+        if (UpdateZoom (Aspect_ScrollDelta (aDelta.y())))
+        {
+          toUpdateView = true;
+        }
+        myMouseProgressPoint = thePoint;
+      }
+      break;
+    }
     case AIS_MouseGesture_Pan:
     {
       if (!myToAllowPanning)