Exemplo n.º 1
0
void SVGInteger::calculateAnimatedValue(SVGAnimationElement* animationElement, float percentage, unsigned repeatCount, PassRefPtr<SVGPropertyBase> from, PassRefPtr<SVGPropertyBase> to, PassRefPtr<SVGPropertyBase> toAtEndOfDuration, SVGElement*)
{
    ASSERT(animationElement);

    RefPtr<SVGInteger> fromInteger = toSVGInteger(from);
    RefPtr<SVGInteger> toInteger = toSVGInteger(to);
    RefPtr<SVGInteger> toAtEndOfDurationInteger = toSVGInteger(toAtEndOfDuration);

    float animatedFloat = m_value;
    animationElement->animateAdditiveNumber(percentage, repeatCount, fromInteger->value(), toInteger->value(), toAtEndOfDurationInteger->value(), animatedFloat);
    m_value = static_cast<int>(roundf(animatedFloat));
}
PassOwnPtr<InterpolationValue> SVGIntegerInterpolationType::maybeConvertSVGValue(const SVGPropertyBase& svgValue) const
{
    if (svgValue.type() != AnimatedInteger)
        return nullptr;
    return InterpolationValue::create(*this, InterpolableNumber::create(toSVGInteger(svgValue).value()));
}
Exemplo n.º 3
0
float SVGInteger::calculateDistance(PassRefPtr<SVGPropertyBase> other, SVGElement*)
{
    return abs(m_value - toSVGInteger(other)->value());
}
Exemplo n.º 4
0
void SVGInteger::add(PassRefPtrWillBeRawPtr<SVGPropertyBase> other, SVGElement*)
{
    setValue(m_value + toSVGInteger(other)->value());
}