本文整理汇总了C++中SVGSVGElement::ChildrenOnlyTransformChanged方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGSVGElement::ChildrenOnlyTransformChanged方法的具体用法?C++ SVGSVGElement::ChildrenOnlyTransformChanged怎么用?C++ SVGSVGElement::ChildrenOnlyTransformChanged使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGSVGElement
的用法示例。
在下文中一共展示了SVGSVGElement::ChildrenOnlyTransformChanged方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
NS_IMETHODIMP
nsSVGInnerSVGFrame::AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType)
{
if (aNameSpaceID == kNameSpaceID_None &&
!(GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD)) {
SVGSVGElement* content = static_cast<SVGSVGElement*>(mContent);
if (aAttribute == nsGkAtoms::width ||
aAttribute == nsGkAtoms::height) {
nsSVGEffects::InvalidateRenderingObservers(this);
nsSVGUtils::ScheduleReflowSVG(this);
if (content->HasViewBoxOrSyntheticViewBox()) {
// make sure our cached transform matrix gets (lazily) updated
mCanvasTM = nullptr;
content->ChildrenOnlyTransformChanged();
nsSVGUtils::NotifyChildrenOfSVGChange(this, TRANSFORM_CHANGED);
} else {
uint32_t flags = COORD_CONTEXT_CHANGED;
if (mCanvasTM && mCanvasTM->IsSingular()) {
mCanvasTM = nullptr;
flags |= TRANSFORM_CHANGED;
}
nsSVGUtils::NotifyChildrenOfSVGChange(this, flags);
}
} else if (aAttribute == nsGkAtoms::transform ||
aAttribute == nsGkAtoms::preserveAspectRatio ||
aAttribute == nsGkAtoms::viewBox ||
aAttribute == nsGkAtoms::x ||
aAttribute == nsGkAtoms::y) {
// make sure our cached transform matrix gets (lazily) updated
mCanvasTM = nullptr;
nsSVGUtils::NotifyChildrenOfSVGChange(
this, aAttribute == nsGkAtoms::viewBox ?
TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED : TRANSFORM_CHANGED);
if (aAttribute == nsGkAtoms::x || aAttribute == nsGkAtoms::y) {
nsSVGEffects::InvalidateRenderingObservers(this);
nsSVGUtils::ScheduleReflowSVG(this);
} else if (aAttribute == nsGkAtoms::transform) {
nsSVGUtils::InvalidateBounds(this, false);
nsSVGUtils::ScheduleReflowSVG(this);
} else if (aAttribute == nsGkAtoms::viewBox ||
(aAttribute == nsGkAtoms::preserveAspectRatio &&
content->HasViewBoxOrSyntheticViewBox())) {
nsSVGUtils::InvalidateBounds(this, false);
nsSVGUtils::ScheduleReflowSVG(this);
content->ChildrenOnlyTransformChanged();
}
}
}
return NS_OK;
}
示例2: if
nsresult
nsSVGInnerSVGFrame::AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType)
{
if (aNameSpaceID == kNameSpaceID_None &&
!(GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
SVGSVGElement* content = static_cast<SVGSVGElement*>(mContent);
if (aAttribute == nsGkAtoms::width ||
aAttribute == nsGkAtoms::height) {
nsSVGEffects::InvalidateRenderingObservers(this);
nsSVGUtils::ScheduleReflowSVG(this);
if (content->HasViewBoxOrSyntheticViewBox()) {
// make sure our cached transform matrix gets (lazily) updated
mCanvasTM = nullptr;
content->ChildrenOnlyTransformChanged();
nsSVGUtils::NotifyChildrenOfSVGChange(this, TRANSFORM_CHANGED);
} else {
uint32_t flags = COORD_CONTEXT_CHANGED;
if (mCanvasTM && mCanvasTM->IsSingular()) {
mCanvasTM = nullptr;
flags |= TRANSFORM_CHANGED;
}
nsSVGUtils::NotifyChildrenOfSVGChange(this, flags);
}
} else if (aAttribute == nsGkAtoms::transform ||
aAttribute == nsGkAtoms::preserveAspectRatio ||
aAttribute == nsGkAtoms::viewBox ||
aAttribute == nsGkAtoms::x ||
aAttribute == nsGkAtoms::y) {
// make sure our cached transform matrix gets (lazily) updated
mCanvasTM = nullptr;
nsSVGUtils::NotifyChildrenOfSVGChange(
this, aAttribute == nsGkAtoms::viewBox ?
TRANSFORM_CHANGED | COORD_CONTEXT_CHANGED : TRANSFORM_CHANGED);
// We don't invalidate for transform changes (the layers code does that).
// Also note that SVGTransformableElement::GetAttributeChangeHint will
// return nsChangeHint_UpdateOverflow for "transform" attribute changes
// and cause DoApplyRenderingChangeToTree to make the SchedulePaint call.
if (aAttribute == nsGkAtoms::x || aAttribute == nsGkAtoms::y) {
nsSVGEffects::InvalidateRenderingObservers(this);
nsSVGUtils::ScheduleReflowSVG(this);
} else if (aAttribute == nsGkAtoms::viewBox ||
(aAttribute == nsGkAtoms::preserveAspectRatio &&
content->HasViewBoxOrSyntheticViewBox())) {
content->ChildrenOnlyTransformChanged();
// SchedulePaint sets a global state flag so we only need to call it once
// (on ourself is fine), not once on each child (despite bug 828240).
SchedulePaint();
}
}
}
return NS_OK;
}