本文整理汇总了C++中SVGDocumentExtensions::removeSVGRootWithRelativeLengthDescendents方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGDocumentExtensions::removeSVGRootWithRelativeLengthDescendents方法的具体用法?C++ SVGDocumentExtensions::removeSVGRootWithRelativeLengthDescendents怎么用?C++ SVGDocumentExtensions::removeSVGRootWithRelativeLengthDescendents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGDocumentExtensions
的用法示例。
在下文中一共展示了SVGDocumentExtensions::removeSVGRootWithRelativeLengthDescendents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateRelativeLengthsInformation
void SVGElement::updateRelativeLengthsInformation(bool clientHasRelativeLengths, SVGElement* clientElement)
{
ASSERT(clientElement);
// If we're not yet in a document, this function will be called again from insertedInto(). Do nothing now.
if (!inDocument())
return;
// An element wants to notify us that its own relative lengths state changed.
// Register it in the relative length map, and register us in the parent relative length map.
// Register the parent in the grandparents map, etc. Repeat procedure until the root of the SVG tree.
for (ContainerNode* currentNode = this; currentNode && currentNode->isSVGElement(); currentNode = currentNode->parentNode()) {
SVGElement* currentElement = toSVGElement(currentNode);
ASSERT(!currentElement->m_inRelativeLengthClientsInvalidation);
bool hadRelativeLengths = currentElement->hasRelativeLengths();
if (clientHasRelativeLengths)
currentElement->m_elementsWithRelativeLengths.add(clientElement);
else
currentElement->m_elementsWithRelativeLengths.remove(clientElement);
// If the relative length state hasn't changed, we can stop propagating the notification.
if (hadRelativeLengths == currentElement->hasRelativeLengths())
return;
clientElement = currentElement;
clientHasRelativeLengths = clientElement->hasRelativeLengths();
}
// Register root SVG elements for top level viewport change notifications.
if (clientElement->isSVGSVGElement()) {
SVGDocumentExtensions* svgExtensions = accessDocumentSVGExtensions();
if (clientElement->hasRelativeLengths())
svgExtensions->addSVGRootWithRelativeLengthDescendents(toSVGSVGElement(clientElement));
else
svgExtensions->removeSVGRootWithRelativeLengthDescendents(toSVGSVGElement(clientElement));
}
}