forked from shadowfacts/Tusker
Fix interactive gallery dismiss going wrong direction when gesture starts out very slow
This commit is contained in:
parent
7c5076d01a
commit
83d4af2303
|
@ -29,7 +29,8 @@ class LargeImageInteractionController: UIPercentDrivenInteractiveTransition {
|
||||||
var progress = translation.y / 200
|
var progress = translation.y / 200
|
||||||
if let direction = direction {
|
if let direction = direction {
|
||||||
progress *= 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
|
direction = progress > 0 ? 1 : -1
|
||||||
progress = abs(progress)
|
progress = abs(progress)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue