本文整理汇总了C++中SVGStyledTransformableElement::getScreenCTM方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGStyledTransformableElement::getScreenCTM方法的具体用法?C++ SVGStyledTransformableElement::getScreenCTM怎么用?C++ SVGStyledTransformableElement::getScreenCTM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGStyledTransformableElement
的用法示例。
在下文中一共展示了SVGStyledTransformableElement::getScreenCTM方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transformOnNonScalingStroke
// FIXME: This does not belong here.
AffineTransform RenderSVGResourceContainer::transformOnNonScalingStroke(RenderObject* object, const AffineTransform& resourceTransform)
{
if (!object->isSVGShape())
return resourceTransform;
SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(object->node());
AffineTransform transform = element->getScreenCTM(SVGLocatable::DisallowStyleUpdate);
transform *= resourceTransform;
return transform;
}
示例2: fillAndStrokePath
void RenderSVGPath::fillAndStrokePath(GraphicsContext* context)
{
RenderStyle* style = this->style();
Color fallbackColor;
if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(this, style, fallbackColor)) {
if (fillPaintingResource->applyResource(this, style, context, ApplyToFillMode))
fillPaintingResource->postApplyResource(this, context, ApplyToFillMode, &m_path);
else if (fallbackColor.isValid()) {
RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::sharedSolidPaintingResource();
fallbackResource->setColor(fallbackColor);
if (fallbackResource->applyResource(this, style, context, ApplyToFillMode))
fallbackResource->postApplyResource(this, context, ApplyToFillMode, &m_path);
}
}
fallbackColor = Color();
RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(this, style, fallbackColor);
if (!strokePaintingResource)
return;
Path path;
bool nonScalingStroke = style->svgStyle()->vectorEffect() == VE_NON_SCALING_STROKE;
GraphicsContextStateSaver stateSaver(*context, false);
if (nonScalingStroke) {
SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
AffineTransform nonScalingStrokeTransform = element->getScreenCTM(SVGLocatable::DisallowStyleUpdate);
if (!nonScalingStrokeTransform.isInvertible())
return;
path = m_path;
path.transform(nonScalingStrokeTransform);
stateSaver.save();
context->concatCTM(nonScalingStrokeTransform.inverse());
}
if (strokePaintingResource->applyResource(this, style, context, ApplyToStrokeMode))
strokePaintingResource->postApplyResource(this, context, ApplyToStrokeMode, nonScalingStroke ? &path : &m_path);
else if (fallbackColor.isValid()) {
RenderSVGResourceSolidColor* fallbackResource = RenderSVGResource::sharedSolidPaintingResource();
fallbackResource->setColor(fallbackColor);
if (fallbackResource->applyResource(this, style, context, ApplyToStrokeMode))
fallbackResource->postApplyResource(this, context, ApplyToStrokeMode, nonScalingStroke ? &path : &m_path);
}
}