本文整理汇总了C++中SVGForeignObjectElement::height方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGForeignObjectElement::height方法的具体用法?C++ SVGForeignObjectElement::height怎么用?C++ SVGForeignObjectElement::height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGForeignObjectElement
的用法示例。
在下文中一共展示了SVGForeignObjectElement::height方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: layout
void RenderSVGForeignObject::layout()
{
ASSERT(needsLayout());
ASSERT(!view()->layoutStateEnabled()); // RenderSVGRoot disables layoutState for the SVG rendering tree.
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
SVGForeignObjectElement* foreign = static_cast<SVGForeignObjectElement*>(node());
bool updateCachedBoundariesInParents = false;
if (m_needsTransformUpdate) {
m_localTransform = foreign->animatedLocalTransform();
m_needsTransformUpdate = false;
updateCachedBoundariesInParents = true;
}
FloatRect oldViewport = m_viewport;
// Cache viewport boundaries
SVGLengthContext lengthContext(foreign);
FloatPoint viewportLocation(foreign->x().value(lengthContext), foreign->y().value(lengthContext));
m_viewport = FloatRect(viewportLocation, FloatSize(foreign->width().value(lengthContext), foreign->height().value(lengthContext)));
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 RenderBoxModelObject would pull this information from RenderStyle - 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 RenderSVGForeignObject & RenderSVGText
setLocation(roundedIntPoint(viewportLocation));
bool layoutChanged = everHadLayout() && selfNeedsLayout();
RenderBlock::layout();
ASSERT(!needsLayout());
// If our bounds changed, notify the parents.
if (updateCachedBoundariesInParents)
RenderSVGBlock::setNeedsBoundariesUpdate();
// Invalidate all resources of this client if our layout changed.
if (layoutChanged)
SVGResourcesCache::clientLayoutChanged(this);
repainter.repaintAfterLayout();
}