From 056bc9b158fc05aaf20c07702dccb4aaf036dddf Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Tue, 28 Feb 2023 14:39:08 +0100 Subject: [PATCH] Viewer: fixed pan/scale gestures interpreted as fling gestures --- CHANGELOG.md | 1 + plugins/aves_magnifier/lib/src/core/core.dart | 20 +++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 781422e5f..42e205fef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. ### Fixed +- viewer pan/scale gestures interpreted as fling gestures - replacing when moving item to vault - exporting item to vault diff --git a/plugins/aves_magnifier/lib/src/core/core.dart b/plugins/aves_magnifier/lib/src/core/core.dart index 531934cd6..58edae587 100644 --- a/plugins/aves_magnifier/lib/src/core/core.dart +++ b/plugins/aves_magnifier/lib/src/core/core.dart @@ -197,18 +197,22 @@ class _MagnifierCoreState extends State with TickerProviderStateM if (_isFlingGesture(estimate, _flingPointerKind, Axis.horizontal)) { final left = _mayFlingLTRB.item1; final right = _mayFlingLTRB.item3; - if (left) { - onFling(AxisDirection.left); - } else if (right) { - onFling(AxisDirection.right); + if (left ^ right) { + if (left) { + onFling(AxisDirection.left); + } else if (right) { + onFling(AxisDirection.right); + } } } else if (_isFlingGesture(estimate, _flingPointerKind, Axis.vertical)) { final up = _mayFlingLTRB.item2; final down = _mayFlingLTRB.item4; - if (up) { - onFling(AxisDirection.up); - } else if (down) { - onFling(AxisDirection.down); + if (up ^ down) { + if (up) { + onFling(AxisDirection.up); + } else if (down) { + onFling(AxisDirection.down); + } } } }