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


C++ SVGEllipseElement::rxCurrentValue方法代码示例

本文整理汇总了C++中SVGEllipseElement::rxCurrentValue方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGEllipseElement::rxCurrentValue方法的具体用法?C++ SVGEllipseElement::rxCurrentValue怎么用?C++ SVGEllipseElement::rxCurrentValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SVGEllipseElement的用法示例。


在下文中一共展示了SVGEllipseElement::rxCurrentValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: calculateRadiiAndCenter

void RenderSVGEllipse::calculateRadiiAndCenter()
{
    ASSERT(element());
    if (element()->hasTagName(SVGNames::circleTag)) {
        SVGCircleElement* circle = toSVGCircleElement(element());

        SVGLengthContext lengthContext(circle);
        float radius = circle->rCurrentValue().value(lengthContext);
        m_radii = FloatSize(radius, radius);
        m_center = FloatPoint(circle->cxCurrentValue().value(lengthContext), circle->cyCurrentValue().value(lengthContext));
        return;
    }

    SVGEllipseElement* ellipse = toSVGEllipseElement(element());

    SVGLengthContext lengthContext(ellipse);
    m_radii = FloatSize(ellipse->rxCurrentValue().value(lengthContext), ellipse->ryCurrentValue().value(lengthContext));
    m_center = FloatPoint(ellipse->cxCurrentValue().value(lengthContext), ellipse->cyCurrentValue().value(lengthContext));
}
开发者ID:Igalia,项目名称:blink,代码行数:19,代码来源:RenderSVGEllipse.cpp

示例2: lengthContext

static TextStream& operator<<(TextStream& ts, const RenderSVGShape& shape)
{
    writePositionAndStyle(ts, shape);

    SVGElement* svgElement = shape.element();
    SVGLengthContext lengthContext(svgElement);

    if (svgElement->hasTagName(SVGNames::rectTag)) {
        SVGRectElement* element = toSVGRectElement(svgElement);
        writeNameValuePair(ts, "x", element->xCurrentValue().value(lengthContext));
        writeNameValuePair(ts, "y", element->yCurrentValue().value(lengthContext));
        writeNameValuePair(ts, "width", element->widthCurrentValue().value(lengthContext));
        writeNameValuePair(ts, "height", element->heightCurrentValue().value(lengthContext));
    } else if (svgElement->hasTagName(SVGNames::lineTag)) {
        SVGLineElement* element = toSVGLineElement(svgElement);
        writeNameValuePair(ts, "x1", element->x1CurrentValue().value(lengthContext));
        writeNameValuePair(ts, "y1", element->y1CurrentValue().value(lengthContext));
        writeNameValuePair(ts, "x2", element->x2CurrentValue().value(lengthContext));
        writeNameValuePair(ts, "y2", element->y2CurrentValue().value(lengthContext));
    } else if (svgElement->hasTagName(SVGNames::ellipseTag)) {
        SVGEllipseElement* element = toSVGEllipseElement(svgElement);
        writeNameValuePair(ts, "cx", element->cxCurrentValue().value(lengthContext));
        writeNameValuePair(ts, "cy", element->cyCurrentValue().value(lengthContext));
        writeNameValuePair(ts, "rx", element->rxCurrentValue().value(lengthContext));
        writeNameValuePair(ts, "ry", element->ryCurrentValue().value(lengthContext));
    } else if (svgElement->hasTagName(SVGNames::circleTag)) {
        SVGCircleElement* element = toSVGCircleElement(svgElement);
        writeNameValuePair(ts, "cx", element->cxCurrentValue().value(lengthContext));
        writeNameValuePair(ts, "cy", element->cyCurrentValue().value(lengthContext));
        writeNameValuePair(ts, "r", element->rCurrentValue().value(lengthContext));
    } else if (svgElement->hasTagName(SVGNames::polygonTag) || svgElement->hasTagName(SVGNames::polylineTag)) {
        writeNameAndQuotedValue(ts, "points", toSVGPolyElement(svgElement)->pointList().valueAsString());
    } else if (svgElement->hasTagName(SVGNames::pathTag)) {
        String pathString;
        // FIXME: We should switch to UnalteredParsing here - this will affect the path dumping output of dozens of tests.
        buildStringFromByteStream(toSVGPathElement(svgElement)->pathByteStream(), pathString, NormalizedParsing);
        writeNameAndQuotedValue(ts, "data", pathString);
    } else
        ASSERT_NOT_REACHED();
    return ts;
}
开发者ID:huningxin,项目名称:blink-crosswalk,代码行数:41,代码来源:SVGRenderTreeAsText.cpp


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