Skip to content

High performance self-hosted photo and video management solution.

fix(mobile): tall image scrolling (#25649)

Mariusf2f11b192461
diff --git a/mobile/lib/widgets/photo_view/src/core/photo_view_gesture_detector.dart b/mobile/lib/widgets/photo_view/src/core/photo_view_gesture_detector.dart
index 7a5406c675..0d2f6fa457 100644
--- a/mobile/lib/widgets/photo_view/src/core/photo_view_gesture_detector.dart
+++ b/mobile/lib/widgets/photo_view/src/core/photo_view_gesture_detector.dart
@@ -203,9 +203,13 @@ class PhotoViewGestureRecognizer extends ScaleGestureRecognizer {
void _decideIfWeAcceptEvent(PointerEvent event) {
final move = _initialFocalPoint! - _currentFocalPoint!;
- final bool shouldMove = validateAxis == Axis.vertical
- ? hitDetector!.shouldMove(move, Axis.vertical)
- : hitDetector!.shouldMove(move, Axis.horizontal);
+
+ // Accept gesture if movement is possible in the direction the user is swiping
+ final bool isHorizontalGesture = move.dx.abs() > move.dy.abs();
+ final bool shouldMove = isHorizontalGesture
+ ? hitDetector!.shouldMove(move, Axis.horizontal)
+ : hitDetector!.shouldMove(move, Axis.vertical);
+
if (shouldMove || _pointerLocations.keys.length > 1) {
final double spanDelta = (_currentSpan! - _initialSpan!).abs();
final double focalPointDelta = (_currentFocalPoint! - _initialFocalPoint!).distance;