本文整理汇总了C++中SVGStyledTransformableElement::hasTagName方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGStyledTransformableElement::hasTagName方法的具体用法?C++ SVGStyledTransformableElement::hasTagName怎么用?C++ SVGStyledTransformableElement::hasTagName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGStyledTransformableElement
的用法示例。
在下文中一共展示了SVGStyledTransformableElement::hasTagName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculateLocalTransform
bool RenderSVGTransformableContainer::calculateLocalTransform()
{
SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
// If we're either the renderer for a <use> element, or for any <g> element inside the shadow
// tree, that was created during the use/symbol/svg expansion in SVGUseElement. These containers
// need to respect the translations induced by their corresponding use elements x/y attributes.
SVGUseElement* useElement = 0;
if (element->hasTagName(SVGNames::useTag))
useElement = static_cast<SVGUseElement*>(element);
else if (element->isInShadowTree() && element->hasTagName(SVGNames::gTag)) {
SVGElement* correspondingElement = element->correspondingElement();
if (correspondingElement && correspondingElement->hasTagName(SVGNames::useTag))
useElement = static_cast<SVGUseElement*>(correspondingElement);
}
if (useElement) {
SVGLengthContext lengthContext(useElement);
FloatSize translation(useElement->x().value(lengthContext), useElement->y().value(lengthContext));
if (translation != m_lastTranslation)
m_needsTransformUpdate = true;
m_lastTranslation = translation;
}
m_didTransformToRootUpdate = m_needsTransformUpdate || SVGRenderSupport::transformToRootChanged(parent());
if (!m_needsTransformUpdate)
return false;
m_localTransform = element->animatedLocalTransform();
m_localTransform.translate(m_lastTranslation.width(), m_lastTranslation.height());
m_needsTransformUpdate = false;
return true;
}
示例2: calculateLocalTransform
bool RenderSVGTransformableContainer::calculateLocalTransform()
{
SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
bool needsUpdate = m_needsTransformUpdate;
if (needsUpdate) {
m_localTransform = element->animatedLocalTransform();
m_needsTransformUpdate = false;
}
if (!element->hasTagName(SVGNames::gTag) || !static_cast<SVGGElement*>(element)->isShadowTreeContainerElement())
return needsUpdate;
FloatSize translation = static_cast<SVGShadowTreeContainerElement*>(element)->containerTranslation();
if (translation.width() == 0 && translation.height() == 0)
return needsUpdate;
// FIXME: Could optimize this case for use to avoid refetching the animatedLocalTransform() here, if only the containerTranslation() changed.
if (!needsUpdate)
m_localTransform = element->animatedLocalTransform();
m_localTransform.translate(translation.width(), translation.height());
return true;
}