From 2b5071585b85300ffae237b66827d354377e1218 Mon Sep 17 00:00:00 2001 From: Simon Jackson Date: Sun, 16 Jul 2017 18:00:43 +0100 Subject: [PATCH] Fix supplied by Anonymous user, resolves issues with fast swipe on fringe pages. Resolves #154 --- Scripts/Layout/HorizontalScrollSnap.cs | 2 +- Scripts/Layout/VerticalScrollSnap.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Layout/HorizontalScrollSnap.cs b/Scripts/Layout/HorizontalScrollSnap.cs index a63900e..3fe3cfe 100644 --- a/Scripts/Layout/HorizontalScrollSnap.cs +++ b/Scripts/Layout/HorizontalScrollSnap.cs @@ -236,7 +236,7 @@ namespace UnityEngine.UI.Extensions if (_scroll_rect.horizontal) { 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; if (_startPosition.x - _screensContainer.localPosition.x > 0) diff --git a/Scripts/Layout/VerticalScrollSnap.cs b/Scripts/Layout/VerticalScrollSnap.cs index ee8e206..8cb9fbf 100644 --- a/Scripts/Layout/VerticalScrollSnap.cs +++ b/Scripts/Layout/VerticalScrollSnap.cs @@ -238,7 +238,7 @@ namespace UnityEngine.UI.Extensions if (_scroll_rect.vertical) { 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; if (_startPosition.y - _screensContainer.localPosition.y > 0)