diff --git a/Scripts/Utilities/UIScrollToSelection.cs b/Scripts/Utilities/UIScrollToSelection.cs index 0b8a73c..a60b29d 100644 --- a/Scripts/Utilities/UIScrollToSelection.cs +++ b/Scripts/Utilities/UIScrollToSelection.cs @@ -203,9 +203,9 @@ namespace UnityEngine.UI.Extensions private float GetScrollOffset(float position, float listAnchorPosition, float targetLength, float maskLength) { - if (position < listAnchorPosition) + if (position < listAnchorPosition + (targetLength / 2)) { - return listAnchorPosition - position; + return (listAnchorPosition + maskLength) - (position - targetLength); } else if (position + targetLength > listAnchorPosition + maskLength) {