File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
mobile/lib/widgets/photo_view/src/core Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -203,9 +203,13 @@ class PhotoViewGestureRecognizer extends ScaleGestureRecognizer {
203203
204204 void _decideIfWeAcceptEvent (PointerEvent event) {
205205 final move = _initialFocalPoint! - _currentFocalPoint! ;
206- final bool shouldMove = validateAxis == Axis .vertical
207- ? hitDetector! .shouldMove (move, Axis .vertical)
208- : hitDetector! .shouldMove (move, Axis .horizontal);
206+
207+ // Accept gesture if movement is possible in the direction the user is swiping
208+ final bool isHorizontalGesture = move.dx.abs () > move.dy.abs ();
209+ final bool shouldMove = isHorizontalGesture
210+ ? hitDetector! .shouldMove (move, Axis .horizontal)
211+ : hitDetector! .shouldMove (move, Axis .vertical);
212+
209213 if (shouldMove || _pointerLocations.keys.length > 1 ) {
210214 final double spanDelta = (_currentSpan! - _initialSpan! ).abs ();
211215 final double focalPointDelta = (_currentFocalPoint! - _initialFocalPoint! ).distance;
You can’t perform that action at this time.
0 commit comments