Fix supplied by Anonymous user, resolves issues with fast swipe on fringe pages.

Resolves #154
pull/413/head
Simon Jackson 2017-07-16 18:00:43 +01:00
parent 3daac5e970
commit 2b5071585b
2 changed files with 2 additions and 2 deletions

View File

@ -236,7 +236,7 @@ namespace UnityEngine.UI.Extensions
if (_scroll_rect.horizontal) if (_scroll_rect.horizontal)
{ {
var distance = Vector3.Distance(_startPosition, _screensContainer.localPosition); var distance = Vector3.Distance(_startPosition, _screensContainer.localPosition);
if (UseFastSwipe && distance < panelDimensions.width + FastSwipeThreshold) if (UseFastSwipe && distance < panelDimensions.width + FastSwipeThreshold && distance >=1f)
{ {
_scroll_rect.velocity = Vector3.zero; _scroll_rect.velocity = Vector3.zero;
if (_startPosition.x - _screensContainer.localPosition.x > 0) if (_startPosition.x - _screensContainer.localPosition.x > 0)

View File

@ -238,7 +238,7 @@ namespace UnityEngine.UI.Extensions
if (_scroll_rect.vertical) if (_scroll_rect.vertical)
{ {
var distance = Vector3.Distance(_startPosition, _screensContainer.localPosition); var distance = Vector3.Distance(_startPosition, _screensContainer.localPosition);
if (UseFastSwipe && distance < panelDimensions.height + FastSwipeThreshold) if (UseFastSwipe && distance < panelDimensions.height + FastSwipeThreshold && distance >=1f)
{ {
_scroll_rect.velocity = Vector3.zero; _scroll_rect.velocity = Vector3.zero;
if (_startPosition.y - _screensContainer.localPosition.y > 0) if (_startPosition.y - _screensContainer.localPosition.y > 0)