当前位置: 首页>>代码示例>>C++>>正文


C++ SVGStyledTransformableElement::getScreenCTM方法代码示例

本文整理汇总了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;
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例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);
    }
}
开发者ID:,项目名称:,代码行数:48,代码来源:


注:本文中的SVGStyledTransformableElement::getScreenCTM方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。