本文整理汇总了C++中SVGLengthList::size方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGLengthList::size方法的具体用法?C++ SVGLengthList::size怎么用?C++ SVGLengthList::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGLengthList
的用法示例。
在下文中一共展示了SVGLengthList::size方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parseMappedAttribute
void SVGTextPositioningElement::parseMappedAttribute(Attribute* attr)
{
if (attr->name() == SVGNames::xAttr) {
SVGLengthList newList;
newList.parse(attr->value(), LengthModeWidth);
detachAnimatedXListWrappers(newList.size());
setXBaseValue(newList);
} else if (attr->name() == SVGNames::yAttr) {
SVGLengthList newList;
newList.parse(attr->value(), LengthModeHeight);
detachAnimatedYListWrappers(newList.size());
setYBaseValue(newList);
} else if (attr->name() == SVGNames::dxAttr) {
SVGLengthList newList;
newList.parse(attr->value(), LengthModeWidth);
detachAnimatedDxListWrappers(newList.size());
setDxBaseValue(newList);
} else if (attr->name() == SVGNames::dyAttr) {
SVGLengthList newList;
newList.parse(attr->value(), LengthModeHeight);
detachAnimatedDyListWrappers(newList.size());
setDyBaseValue(newList);
} else if (attr->name() == SVGNames::rotateAttr) {
SVGNumberList newList;
newList.parse(attr->value());
detachAnimatedRotateListWrappers(newList.size());
setRotateBaseValue(newList);
} else
SVGTextContentElement::parseMappedAttribute(attr);
}
示例2: parseAttribute
void SVGTextPositioningElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (!isSupportedAttribute(name)) {
SVGTextContentElement::parseAttribute(name, value);
return;
}
if (name == SVGNames::xAttr) {
SVGLengthList newList;
newList.parse(value, LengthModeWidth);
detachAnimatedXListWrappers(newList.size());
setXBaseValue(newList);
return;
}
if (name == SVGNames::yAttr) {
SVGLengthList newList;
newList.parse(value, LengthModeHeight);
detachAnimatedYListWrappers(newList.size());
setYBaseValue(newList);
return;
}
if (name == SVGNames::dxAttr) {
SVGLengthList newList;
newList.parse(value, LengthModeWidth);
detachAnimatedDxListWrappers(newList.size());
setDxBaseValue(newList);
return;
}
if (name == SVGNames::dyAttr) {
SVGLengthList newList;
newList.parse(value, LengthModeHeight);
detachAnimatedDyListWrappers(newList.size());
setDyBaseValue(newList);
return;
}
if (name == SVGNames::rotateAttr) {
SVGNumberList newList;
newList.parse(value);
detachAnimatedRotateListWrappers(newList.size());
setRotateBaseValue(newList);
return;
}
ASSERT_NOT_REACHED();
}
示例3: extractFloatValuesFromSVGLengthList
static inline void extractFloatValuesFromSVGLengthList(SVGElement* lengthContext, const SVGLengthList& list, Vector<float>& floatValues, unsigned textContentLength)
{
ASSERT(lengthContext);
unsigned length = list.size();
if (length > textContentLength)
length = textContentLength;
floatValues.reserveCapacity(length);
for (unsigned i = 0; i < length; ++i) {
const SVGLength& length = list.at(i);
floatValues.append(length.value(lengthContext));
}
}
示例4: calculateAnimatedValue
void SVGAnimatedLengthListAnimator::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGAnimatedType* from, SVGAnimatedType* to, SVGAnimatedType* toAtEndOfDuration, SVGAnimatedType* animated)
{
ASSERT(m_animationElement);
ASSERT(m_contextElement);
SVGLengthList fromLengthList = m_animationElement->animationMode() == ToAnimation ? animated->lengthList() : from->lengthList();
SVGLengthList toLengthList = to->lengthList();
const SVGLengthList& toAtEndOfDurationLengthList = toAtEndOfDuration->lengthList();
SVGLengthList& animatedLengthList = animated->lengthList();
// Apply CSS inheritance rules.
m_animationElement->adjustForInheritance<SVGLengthList>(parseLengthListFromString, m_animationElement->fromPropertyValueType(), fromLengthList, m_contextElement);
m_animationElement->adjustForInheritance<SVGLengthList>(parseLengthListFromString, m_animationElement->toPropertyValueType(), toLengthList, m_contextElement);
if (!m_animationElement->adjustFromToListValues<SVGLengthList>(fromLengthList, toLengthList, animatedLengthList, percentage))
return;
unsigned fromLengthListSize = fromLengthList.size();
unsigned toLengthListSize = toLengthList.size();
unsigned toAtEndOfDurationListSize = toAtEndOfDurationLengthList.size();
SVGLengthContext lengthContext(m_contextElement);
for (unsigned i = 0; i < toLengthListSize; ++i) {
float animatedNumber = animatedLengthList[i].value(lengthContext);
SVGLengthType unitType = toLengthList[i].unitType();
float effectiveFrom = 0;
if (fromLengthListSize) {
if (percentage < 0.5)
unitType = fromLengthList[i].unitType();
effectiveFrom = fromLengthList[i].value(lengthContext);
}
float effectiveToAtEnd = i < toAtEndOfDurationListSize ? toAtEndOfDurationLengthList[i].value(lengthContext) : 0;
m_animationElement->animateAdditiveNumber(percentage, repeatCount, effectiveFrom, toLengthList[i].value(lengthContext), effectiveToAtEnd, animatedNumber);
animatedLengthList[i].setValue(lengthContext, animatedNumber, m_lengthMode, unitType, ASSERT_NO_EXCEPTION);
}
}