Fix interactive gallery dismiss going wrong direction when gesture starts out very slow

This commit is contained in:
Shadowfacts 2021-09-21 23:46:22 -04:00
parent 7c5076d01a
commit 83d4af2303
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,8 @@ class LargeImageInteractionController: UIPercentDrivenInteractiveTransition {
var progress = translation.y / 200
if let direction = direction {
progress *= direction
} else {
} else if abs(progress) > 0.01 {
// if the progress is less than +/- 1%, don't set the direction because the translation may be random jitter in the user's finger
direction = progress > 0 ? 1 : -1
progress = abs(progress)
}