diff --git a/client/Assets/Vanguard/Runtime/UI/SmoothScrollRect.cs b/client/Assets/Vanguard/Runtime/UI/SmoothScrollRect.cs index 1d8baf3..eee32e5 100644 --- a/client/Assets/Vanguard/Runtime/UI/SmoothScrollRect.cs +++ b/client/Assets/Vanguard/Runtime/UI/SmoothScrollRect.cs @@ -27,8 +27,12 @@ namespace Vanguard.UI if (!_smooth) _target = content.anchoredPosition.y; + var direction = Mathf.Sign(eventData.scrollDelta.y); + if (Mathf.Approximately(direction, 0f)) + return; + var max = Mathf.Max(0f, content.rect.height - viewport.rect.height); - _target = Mathf.Clamp(_target - eventData.scrollDelta.y * WheelStep, 0f, max); + _target = Mathf.Clamp(_target - direction * WheelStep, 0f, max); velocity = Vector2.zero; _smooth = true; }