float SVGAnimationElement::calculatePercentForSpline(float percent, unsigned splineIndex) const { ASSERT(calcMode() == CalcModeSpline); ASSERT(splineIndex < m_keySplines.size()); UnitBezier bezier = m_keySplines[splineIndex]; SMILTime duration = simpleDuration(); if (!duration.isFinite()) duration = 100.0; return narrowPrecisionToFloat(bezier.solve(percent, solveEpsilon(duration.value()))); }
transition::state ease_transition<T>::update(TimePoint now) const { float t = progress(now); if (t >= 1) { value = to; return complete; } else { value = interpolate(from, to, ease.solve(t, 0.001)); return running; } }