From f60082f9fb70440a6e77c3e37918de166bacc264 Mon Sep 17 00:00:00 2001 From: carlosah Date: Tue, 24 Oct 2023 14:20:10 +0000 Subject: [PATCH] 0033513: Zooming - Only working when mouse move horizontally --- src/AIS/AIS_MouseGesture.hxx | 1 + src/AIS/AIS_ViewController.cxx | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/AIS/AIS_MouseGesture.hxx b/src/AIS/AIS_MouseGesture.hxx index b972e84451..c74da650a1 100644 --- a/src/AIS/AIS_MouseGesture.hxx +++ b/src/AIS/AIS_MouseGesture.hxx @@ -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 diff --git a/src/AIS/AIS_ViewController.cxx b/src/AIS/AIS_ViewController.cxx index 12ad1ef617..0eed999d9b 100644 --- a/src/AIS/AIS_ViewController.cxx +++ b/src/AIS/AIS_ViewController.cxx @@ -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)