mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
fix(mobile): tall image scrolling (#25649)
Add cross-axis gesture detection in PhotoView so vertical scrolling works on tall images that don't fill the screen width (have black bars)
This commit is contained in:
parent
141be5cbc9
commit
f2f11b1924
1 changed files with 7 additions and 3 deletions
|
|
@ -203,9 +203,13 @@ class PhotoViewGestureRecognizer extends ScaleGestureRecognizer {
|
||||||
|
|
||||||
void _decideIfWeAcceptEvent(PointerEvent event) {
|
void _decideIfWeAcceptEvent(PointerEvent event) {
|
||||||
final move = _initialFocalPoint! - _currentFocalPoint!;
|
final move = _initialFocalPoint! - _currentFocalPoint!;
|
||||||
final bool shouldMove = validateAxis == Axis.vertical
|
|
||||||
? hitDetector!.shouldMove(move, Axis.vertical)
|
// Accept gesture if movement is possible in the direction the user is swiping
|
||||||
: hitDetector!.shouldMove(move, Axis.horizontal);
|
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) {
|
if (shouldMove || _pointerLocations.keys.length > 1) {
|
||||||
final double spanDelta = (_currentSpan! - _initialSpan!).abs();
|
final double spanDelta = (_currentSpan! - _initialSpan!).abs();
|
||||||
final double focalPointDelta = (_currentFocalPoint! - _initialFocalPoint!).distance;
|
final double focalPointDelta = (_currentFocalPoint! - _initialFocalPoint!).distance;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue