当前位置: 首页>>代码示例>>C++>>正文


C++ SVGLengthList::at方法代码示例

本文整理汇总了C++中SVGLengthList::at方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGLengthList::at方法的具体用法?C++ SVGLengthList::at怎么用?C++ SVGLengthList::at使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SVGLengthList的用法示例。


在下文中一共展示了SVGLengthList::at方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: calculateAnimatedValue

void SVGLengthList::calculateAnimatedValue(
    SVGAnimationElement* animationElement,
    float percentage,
    unsigned repeatCount,
    SVGPropertyBase* fromValue,
    SVGPropertyBase* toValue,
    SVGPropertyBase* toAtEndOfDurationValue,
    SVGElement* contextElement) {
  SVGLengthList* fromList = toSVGLengthList(fromValue);
  SVGLengthList* toList = toSVGLengthList(toValue);
  SVGLengthList* toAtEndOfDurationList =
      toSVGLengthList(toAtEndOfDurationValue);

  SVGLengthContext lengthContext(contextElement);
  ASSERT(m_mode == SVGLength::lengthModeForAnimatedLengthAttribute(
                       animationElement->attributeName()));

  size_t fromLengthListSize = fromList->length();
  size_t toLengthListSize = toList->length();
  size_t toAtEndOfDurationListSize = toAtEndOfDurationList->length();

  if (!adjustFromToListValues(fromList, toList, percentage,
                              animationElement->getAnimationMode()))
    return;

  for (size_t i = 0; i < toLengthListSize; ++i) {
    // TODO(shanmuga.m): Support calc for SVGLengthList animation
    float animatedNumber = at(i)->value(lengthContext);
    CSSPrimitiveValue::UnitType unitType =
        toList->at(i)->typeWithCalcResolved();
    float effectiveFrom = 0;
    if (fromLengthListSize) {
      if (percentage < 0.5)
        unitType = fromList->at(i)->typeWithCalcResolved();
      effectiveFrom = fromList->at(i)->value(lengthContext);
    }
    float effectiveTo = toList->at(i)->value(lengthContext);
    float effectiveToAtEnd =
        i < toAtEndOfDurationListSize
            ? toAtEndOfDurationList->at(i)->value(lengthContext)
            : 0;

    animationElement->animateAdditiveNumber(percentage, repeatCount,
                                            effectiveFrom, effectiveTo,
                                            effectiveToAtEnd, animatedNumber);
    at(i)->setUnitType(unitType);
    at(i)->setValue(animatedNumber, lengthContext);
  }
}
开发者ID:mirror,项目名称:chromium,代码行数:49,代码来源:SVGLengthList.cpp

示例2: add

void SVGLengthList::add(SVGPropertyBase* other, SVGElement* contextElement) {
  SVGLengthList* otherList = toSVGLengthList(other);

  if (length() != otherList->length())
    return;

  SVGLengthContext lengthContext(contextElement);
  for (size_t i = 0; i < length(); ++i)
    at(i)->setValue(
        at(i)->value(lengthContext) + otherList->at(i)->value(lengthContext),
        lengthContext);
}
开发者ID:mirror,项目名称:chromium,代码行数:12,代码来源:SVGLengthList.cpp

示例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));
    }
}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:14,代码来源:SVGTextLayoutAttributesBuilder.cpp


注:本文中的SVGLengthList::at方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。