diff --git a/client/Assets/Vanguard/Runtime/UI/DeckBuilderView.cs b/client/Assets/Vanguard/Runtime/UI/DeckBuilderView.cs index ab8239c..5ce4461 100644 --- a/client/Assets/Vanguard/Runtime/UI/DeckBuilderView.cs +++ b/client/Assets/Vanguard/Runtime/UI/DeckBuilderView.cs @@ -213,6 +213,10 @@ namespace Vanguard.UI scrollElement.flexibleHeight = 1f; scrollElement.minHeight = 220f; + var smooth = scroll.GetComponent(); + if (smooth != null) + smooth.WheelStep = 448f; + var grid = _collectionContent.GetComponent(); if (grid != null) grid.childAlignment = TextAnchor.UpperLeft; diff --git a/client/Assets/Vanguard/Runtime/UI/SmoothScrollRect.cs b/client/Assets/Vanguard/Runtime/UI/SmoothScrollRect.cs index 7d3bc1e..1d8baf3 100644 --- a/client/Assets/Vanguard/Runtime/UI/SmoothScrollRect.cs +++ b/client/Assets/Vanguard/Runtime/UI/SmoothScrollRect.cs @@ -28,7 +28,7 @@ namespace Vanguard.UI _target = content.anchoredPosition.y; var max = Mathf.Max(0f, content.rect.height - viewport.rect.height); - _target = Mathf.Clamp(_target + eventData.scrollDelta.y * WheelStep, -max, 0f); + _target = Mathf.Clamp(_target - eventData.scrollDelta.y * WheelStep, 0f, max); velocity = Vector2.zero; _smooth = true; } @@ -49,7 +49,7 @@ namespace Vanguard.UI var position = content.anchoredPosition; var max = Mathf.Max(0f, content.rect.height - viewport.rect.height); - _target = Mathf.Clamp(_target, -max, 0f); + _target = Mathf.Clamp(_target, 0f, max); var t = 1f - Mathf.Exp(-Time.unscaledDeltaTime / Mathf.Max(0.01f, Smoothing)); var next = Mathf.Lerp(position.y, _target, t);