| Index: cc/animation/scroll_offset_animation_curve.cc
|
| diff --git a/cc/animation/scroll_offset_animation_curve.cc b/cc/animation/scroll_offset_animation_curve.cc
|
| index 5b95f561685fa48533c61b4a1efebb5c894ae3e0..7655b0da5a4f1e52a3d48d6a566e964e72e2f133 100644
|
| --- a/cc/animation/scroll_offset_animation_curve.cc
|
| +++ b/cc/animation/scroll_offset_animation_curve.cc
|
| @@ -114,17 +114,25 @@ void ScrollOffsetAnimationCurve::ApplyAdjustment(
|
| target_value_ = ScrollOffsetWithDelta(target_value_, adjustment);
|
| }
|
|
|
| +void ScrollOffsetAnimationCurve::AdjustDuration(base::TimeDelta adjustment) {
|
| + base::TimeDelta old_duration = total_animation_duration_ - last_retarget_;
|
| + base::TimeDelta new_duration = old_duration - adjustment;
|
| + if (new_duration <= base::TimeDelta())
|
| + new_duration = base::TimeDelta();
|
| + total_animation_duration_ -= old_duration - new_duration;
|
| +}
|
| +
|
| gfx::ScrollOffset ScrollOffsetAnimationCurve::GetValue(
|
| base::TimeDelta t) const {
|
| base::TimeDelta duration = total_animation_duration_ - last_retarget_;
|
| t -= last_retarget_;
|
|
|
| - if (t <= base::TimeDelta())
|
| - return initial_value_;
|
| -
|
| if (t >= duration)
|
| return target_value_;
|
|
|
| + if (t <= base::TimeDelta())
|
| + return initial_value_;
|
| +
|
| double progress = timing_function_->GetValue(TimeUtil::Divide(t, duration));
|
| return gfx::ScrollOffset(
|
| gfx::Tween::FloatValueBetween(
|
|
|