Slider animation duration fix

commit_hash:5549fcb7c36a8c7116d975fd23cdc5b878c64c67
This commit is contained in:
denlvovich
2026-02-25 01:58:41 +03:00
parent f4d2da5df5
commit 71d964e01b
@@ -303,9 +303,9 @@ final class SliderView: BlockView, VisibleBoundsTrackingLeaf {
to newValue: Double,
from oldValue: Double
) {
let normalizedDelta = abs(newValue - oldValue) / Double(max(1, sliderModel.valueRange))
let animationDuration = animationDuration * 2 * abs(newValue - oldValue) / sliderModel.stepSize
thumbAnimator = .runningPropertyAnimator(
withDuration: animationDuration * 2 * normalizedDelta,
withDuration: animationDuration,
delay: 0,
options: [.allowUserInteraction, .curveEaseIn],
animations: { [self] in