Fix supplied by Anonymous user, resolves issues with fast swipe on fringe pages.
Resolves #154pull/413/head
parent
3daac5e970
commit
2b5071585b
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue