client: одно деление колеса — одна полоса карт
CI / test (push) Successful in 4m14s
Details
CI / test (push) Successful in 4m14s
Details
- SmoothScrollRect нормализует величину колеса через Mathf.Sign: standalone присылает scrollDelta ≈ 6 за щелчок, из-за чего шаг 448 умножался на 6 (6 полос). - Проверки: EditMode 69/69, standalone собран.
This commit is contained in:
parent
40759d2494
commit
55f57beed5
|
|
@ -27,8 +27,12 @@ namespace Vanguard.UI
|
||||||
if (!_smooth)
|
if (!_smooth)
|
||||||
_target = content.anchoredPosition.y;
|
_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);
|
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;
|
velocity = Vector2.zero;
|
||||||
_smooth = true;
|
_smooth = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue