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


C++ SVGForeignObjectElement::calculateAnimatedLocalTransform方法代码示例

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


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

示例1: layout

void LayoutSVGForeignObject::layout() {
  ASSERT(needsLayout());

  SVGForeignObjectElement* foreign = toSVGForeignObjectElement(node());

  bool updateCachedBoundariesInParents = false;
  if (m_needsTransformUpdate) {
    m_localTransform = foreign->calculateAnimatedLocalTransform();
    m_needsTransformUpdate = false;
    updateCachedBoundariesInParents = true;
  }

  FloatRect oldViewport = m_viewport;

  // Cache viewport boundaries
  SVGLengthContext lengthContext(foreign);
  FloatPoint viewportLocation(
      lengthContext.valueForLength(styleRef().svgStyle().x(), styleRef(),
                                   SVGLengthMode::Width),
      lengthContext.valueForLength(styleRef().svgStyle().y(), styleRef(),
                                   SVGLengthMode::Height));
  m_viewport = FloatRect(
      viewportLocation,
      FloatSize(lengthContext.valueForLength(styleRef().width(), styleRef(),
                                             SVGLengthMode::Width),
                lengthContext.valueForLength(styleRef().height(), styleRef(),
                                             SVGLengthMode::Height)));
  if (!updateCachedBoundariesInParents)
    updateCachedBoundariesInParents = oldViewport != m_viewport;

  // Set box origin to the foreignObject x/y translation, so positioned objects
  // in XHTML content get correct positions. A regular LayoutBoxModelObject
  // would pull this information from ComputedStyle - in SVG those properties
  // are ignored for non <svg> elements, so we mimic what happens when
  // specifying them through CSS.

  // FIXME: Investigate in location rounding issues - only affects
  // LayoutSVGForeignObject & LayoutSVGText
  setLocation(roundedIntPoint(viewportLocation));

  bool layoutChanged = everHadLayout() && selfNeedsLayout();
  LayoutBlock::layout();
  ASSERT(!needsLayout());

  // If our bounds changed, notify the parents.
  if (updateCachedBoundariesInParents)
    LayoutSVGBlock::setNeedsBoundariesUpdate();

  // Invalidate all resources of this client if our layout changed.
  if (layoutChanged)
    SVGResourcesCache::clientLayoutChanged(this);
}
开发者ID:mirror,项目名称:chromium,代码行数:52,代码来源:LayoutSVGForeignObject.cpp


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