mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
Slider animation duration fix
commit_hash:5549fcb7c36a8c7116d975fd23cdc5b878c64c67
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user