diff --git a/Scripts/Layout/HorizontalScrollSnap.cs b/Scripts/Layout/HorizontalScrollSnap.cs index f3c01a0..fa532c2 100644 --- a/Scripts/Layout/HorizontalScrollSnap.cs +++ b/Scripts/Layout/HorizontalScrollSnap.cs @@ -250,6 +250,6 @@ namespace UnityEngine.UI.Extensions } } } - #endregion + #endregion } } \ No newline at end of file diff --git a/Scripts/Layout/ScrollSnapBase.cs b/Scripts/Layout/ScrollSnapBase.cs index b7aea59..c07771f 100644 --- a/Scripts/Layout/ScrollSnapBase.cs +++ b/Scripts/Layout/ScrollSnapBase.cs @@ -314,8 +314,8 @@ namespace UnityEngine.UI.Extensions internal int GetPageforPosition(Vector3 pos) { return _isVertical ? - -(int)Math.Round((pos.y - _scrollStartPosition) / _childSize) : - -(int)Math.Round((pos.x - _scrollStartPosition) / _childSize); + (int)Math.Round((_scrollStartPosition - pos.y) / _childSize) : + (int)Math.Round((_scrollStartPosition - pos.x) / _childSize); } ///