void InterpolableAnimatableValue::interpolate(const InterpolableValue& to, const double progress, InterpolableValue& result) const
{
    const InterpolableAnimatableValue& toValue = toInterpolableAnimatableValue(to);
    InterpolableAnimatableValue& resultValue = toInterpolableAnimatableValue(result);
    if (progress == 0)
        resultValue.m_value = m_value;
    if (progress == 1)
        resultValue.m_value = toValue.m_value;
    resultValue.m_value = AnimatableValue::interpolate(m_value.get(), toValue.m_value.get(), progress);
}
Пример #2
0
PassOwnPtrWillBeRawPtr<InterpolableValue> InterpolableAnimatableValue::interpolate(const InterpolableValue &other, const double percentage) const
{
    const InterpolableAnimatableValue *otherValue = toInterpolableAnimatableValue(&other);
    if (!percentage)
        return create(m_value);
    if (percentage == 1)
        return create(otherValue->m_value);
    return create(AnimatableValue::interpolate(m_value.get(), otherValue->m_value.get(), percentage));
}