Index: cc/animation/timing_function.cc |
diff --git a/cc/animation/timing_function.cc b/cc/animation/timing_function.cc |
index b7308bb31c9564fa588a296172a640a631ac70e0..d0d55ad54fa75f6357fc3318229048a7d49e54f0 100644 |
--- a/cc/animation/timing_function.cc |
+++ b/cc/animation/timing_function.cc |
@@ -109,8 +109,12 @@ float StepsTimingFunction::Velocity(double x) const { |
double StepsTimingFunction::GetPreciseValue(double t) const { |
const double steps = static_cast<double>(steps_); |
- return MathUtil::ClampToRange( |
- std::floor((steps * t) + GetStepsStartOffset()) / steps, 0.0, 1.0); |
+ double current_step = std::floor((steps * t) + GetStepsStartOffset()); |
+ if (t >= 0 && current_step < 0) |
+ current_step = 0; |
+ if (t <= 1 && current_step > steps) |
+ current_step = steps; |
+ return current_step / steps; |
} |
float StepsTimingFunction::GetStepsStartOffset() const { |