void SVGNumberList::add(SVGPropertyBase* other, SVGElement* contextElement) { SVGNumberList* otherList = toSVGNumberList(other); if (length() != otherList->length()) return; for (size_t i = 0; i < length(); ++i) at(i)->setValue(at(i)->value() + otherList->at(i)->value()); }
void SVGNumberList::calculateAnimatedValue(SVGAnimationElement* animationElement, float percentage, unsigned repeatCount, SVGPropertyBase* fromValue, SVGPropertyBase* toValue, SVGPropertyBase* toAtEndOfDurationValue, SVGElement* contextElement) { SVGNumberList* fromList = toSVGNumberList(fromValue); SVGNumberList* toList = toSVGNumberList(toValue); SVGNumberList* toAtEndOfDurationList = toSVGNumberList(toAtEndOfDurationValue); size_t fromListSize = fromList->length(); size_t toListSize = toList->length(); size_t toAtEndOfDurationListSize = toAtEndOfDurationList->length(); if (!adjustFromToListValues(fromList, toList, percentage, animationElement->getAnimationMode())) return; for (size_t i = 0; i < toListSize; ++i) { float effectiveFrom = fromListSize ? fromList->at(i)->value() : 0; float effectiveTo = toListSize ? toList->at(i)->value() : 0; float effectiveToAtEnd = i < toAtEndOfDurationListSize ? toAtEndOfDurationList->at(i)->value() : 0; float animated = at(i)->value(); animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom, effectiveTo, effectiveToAtEnd, animated); at(i)->setValue(animated); } }