本文整理汇总了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);
}