本文整理汇总了C++中SVGSVGElement::hasSetContainerSize方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGSVGElement::hasSetContainerSize方法的具体用法?C++ SVGSVGElement::hasSetContainerSize怎么用?C++ SVGSVGElement::hasSetContainerSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGSVGElement
的用法示例。
在下文中一共展示了SVGSVGElement::hasSetContainerSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: usesContainerSize
bool SVGImage::usesContainerSize() const
{
if (!m_frame || !m_frame->document())
return false;
SVGSVGElement* rootElement = static_cast<SVGDocument*>(m_frame->document())->rootElement();
if (!rootElement)
return false;
return rootElement->hasSetContainerSize();
}
示例2: usesContainerSize
bool SVGImage::usesContainerSize() const
{
if (!m_page)
return false;
Frame* frame = m_page->mainFrame();
SVGSVGElement* rootElement = static_cast<SVGDocument*>(frame->document())->rootElement();
if (!rootElement)
return false;
return rootElement->hasSetContainerSize();
}
示例3: calcViewport
void RenderSVGRoot::calcViewport()
{
SVGSVGElement* svg = static_cast<SVGSVGElement*>(node());
if (!svg->hasSetContainerSize()) {
// In the normal case of <svg> being stand-alone or in a CSSBoxModel object we use
// RenderBox::width()/height() (which pulls data from RenderStyle)
m_viewportSize = FloatSize(width(), height());
return;
}
// In the SVGImage case grab the SVGLength values off of SVGSVGElement and use
// the special relativeWidthValue accessors which respect the specified containerSize
// FIXME: Check how SVGImage + zooming is supposed to be handled?
SVGLength width = svg->width();
SVGLength height = svg->height();
m_viewportSize = FloatSize(width.unitType() == LengthTypePercentage ? svg->relativeWidthValue() : width.value(svg),
height.unitType() == LengthTypePercentage ? svg->relativeHeightValue() : height.value(svg));
}
示例4: calcViewport
void RenderSVGRoot::calcViewport()
{
SVGSVGElement* svg = static_cast<SVGSVGElement*>(node());
if (!selfNeedsLayout() && !svg->hasRelativeValues())
return;
if (!svg->hasSetContainerSize()) {
// In the normal case of <svg> being stand-alone or in a CSSBoxModel object we use
// RenderBox::width()/height() (which pulls data from RenderStyle)
m_viewportSize = FloatSize(width(), height());
} else {
// In the SVGImage case grab the SVGLength values off of SVGSVGElement and use
// the special relativeWidthValue accessors which respect the specified containerSize
SVGLength width = svg->width();
SVGLength height = svg->height();
float viewportWidth = (width.unitType() == LengthTypePercentage) ? svg->relativeWidthValue() : width.value(svg);
float viewportHeight = (height.unitType() == LengthTypePercentage) ? svg->relativeHeightValue() : height.value(svg);
m_viewportSize = FloatSize(viewportWidth, viewportHeight);
}
}