| 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 a3831432897b6f8b3b71295254768597d06f2e8e..c1bfe63e0344479ab90bd3af89ddde08844bd556 100644
|
| --- a/cc/animation/scroll_offset_animation_curve.cc
|
| +++ b/cc/animation/scroll_offset_animation_curve.cc
|
| @@ -207,18 +207,6 @@ void ScrollOffsetAnimationCurve::UpdateTarget(
|
| return;
|
| }
|
|
|
| - // The total_animation_duration_ is zero because of the delay that we
|
| - // accounted for when the animation was created. The new duration should
|
| - // also take the delay into account.
|
| - if (total_animation_duration_.is_zero()) {
|
| - DCHECK_LE(t, 0);
|
| - total_animation_duration_ =
|
| - SegmentDuration(new_target.DeltaFrom(initial_value_),
|
| - duration_behavior_, base::TimeDelta::FromSecondsD(-t));
|
| - target_value_ = new_target;
|
| - return;
|
| - }
|
| -
|
| base::TimeDelta delayed_by = base::TimeDelta::FromSecondsD(
|
| std::max(0.0, last_retarget_.InSecondsF() - t));
|
| t = std::max(t, last_retarget_.InSecondsF());
|
| @@ -228,6 +216,15 @@ void ScrollOffsetAnimationCurve::UpdateTarget(
|
| gfx::Vector2dF old_delta = target_value_.DeltaFrom(initial_value_);
|
| gfx::Vector2dF new_delta = new_target.DeltaFrom(current_position);
|
|
|
| + // The last segement was of zero duration.
|
| + if ((total_animation_duration_ - last_retarget_).is_zero()) {
|
| + DCHECK_EQ(t, last_retarget_.InSecondsF());
|
| + total_animation_duration_ =
|
| + SegmentDuration(new_delta, duration_behavior_, delayed_by);
|
| + target_value_ = new_target;
|
| + return;
|
| + }
|
| +
|
| double old_duration =
|
| (total_animation_duration_ - last_retarget_).InSecondsF();
|
| double old_normalized_velocity = timing_function_->Velocity(
|
|
|