Viewer: fixed pan/scale gestures interpreted as fling gestures

This commit is contained in:
Thibault Deckers 2023-02-28 14:39:08 +01:00
parent 6696f97ab2
commit 056bc9b158
2 changed files with 13 additions and 8 deletions

View file

@ -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

View file

@ -197,18 +197,22 @@ class _MagnifierCoreState extends State<MagnifierCore> 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);
}
}
}
}