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


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

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


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

示例1: updatePathFromEllipseElement

static void updatePathFromEllipseElement(SVGElement* element, Path& path)
{
    SVGEllipseElement* ellipse = toSVGEllipseElement(element);

    SVGLengthContext lengthContext(element);
    float rx = ellipse->rx().value(lengthContext);
    if (rx <= 0)
        return;
    float ry = ellipse->ry().value(lengthContext);
    if (ry <= 0)
        return;
    path.addEllipse(FloatRect(ellipse->cx().value(lengthContext) - rx, ellipse->cy().value(lengthContext) - ry, rx * 2, ry * 2));
}
开发者ID:Happy-Ferret,项目名称:webkit.js,代码行数:13,代码来源:SVGPathData.cpp

示例2: updatePathFromEllipseElement

static void updatePathFromEllipseElement(SVGElement* element, Path& path)
{
    ASSERT_WITH_SECURITY_IMPLICATION(element->hasTagName(SVGNames::ellipseTag));
    SVGEllipseElement* ellipse = static_cast<SVGEllipseElement*>(element);

    SVGLengthContext lengthContext(element);
    float rx = ellipse->rx().value(lengthContext);
    if (rx <= 0)
        return;
    float ry = ellipse->ry().value(lengthContext);
    if (ry <= 0)
        return;
    path.addEllipse(FloatRect(ellipse->cx().value(lengthContext) - rx, ellipse->cy().value(lengthContext) - ry, rx * 2, ry * 2));
}
开发者ID:kodybrown,项目名称:webkit,代码行数:14,代码来源:SVGPathData.cpp

示例3: lengthContext

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

    ASSERT(shape.node()->isSVGElement());
    SVGElement* svgElement = toSVGElement(shape.node());
    SVGLengthContext lengthContext(svgElement);

    if (svgElement->hasTagName(SVGNames::rectTag)) {
        SVGRectElement* element = static_cast<SVGRectElement*>(svgElement);
        writeNameValuePair(ts, "x", element->x().value(lengthContext));
        writeNameValuePair(ts, "y", element->y().value(lengthContext));
        writeNameValuePair(ts, "width", element->width().value(lengthContext));
        writeNameValuePair(ts, "height", element->height().value(lengthContext));
    } else if (svgElement->hasTagName(SVGNames::lineTag)) {
        SVGLineElement* element = static_cast<SVGLineElement*>(svgElement);
        writeNameValuePair(ts, "x1", element->x1().value(lengthContext));
        writeNameValuePair(ts, "y1", element->y1().value(lengthContext));
        writeNameValuePair(ts, "x2", element->x2().value(lengthContext));
        writeNameValuePair(ts, "y2", element->y2().value(lengthContext));
    } else if (svgElement->hasTagName(SVGNames::ellipseTag)) {
        SVGEllipseElement* element = static_cast<SVGEllipseElement*>(svgElement);
        writeNameValuePair(ts, "cx", element->cx().value(lengthContext));
        writeNameValuePair(ts, "cy", element->cy().value(lengthContext));
        writeNameValuePair(ts, "rx", element->rx().value(lengthContext));
        writeNameValuePair(ts, "ry", element->ry().value(lengthContext));
    } else if (svgElement->hasTagName(SVGNames::circleTag)) {
        SVGCircleElement* element = static_cast<SVGCircleElement*>(svgElement);
        writeNameValuePair(ts, "cx", element->cx().value(lengthContext));
        writeNameValuePair(ts, "cy", element->cy().value(lengthContext));
        writeNameValuePair(ts, "r", element->r().value(lengthContext));
    } else if (svgElement->hasTagName(SVGNames::polygonTag) || svgElement->hasTagName(SVGNames::polylineTag)) {
        SVGPolyElement* element = static_cast<SVGPolyElement*>(svgElement);
        writeNameAndQuotedValue(ts, "points", element->pointList().valueAsString());
    } else if (svgElement->hasTagName(SVGNames::pathTag)) {
        SVGPathElement* element = toSVGPathElement(svgElement);
        String pathString;
        // FIXME: We should switch to UnalteredParsing here - this will affect the path dumping output of dozens of tests.
        buildStringFromByteStream(element->pathByteStream(), pathString, NormalizedParsing);
        writeNameAndQuotedValue(ts, "data", pathString);
    } else
        ASSERT_NOT_REACHED();
    return ts;
}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:44,代码来源:SVGRenderTreeAsText.cpp

示例4: calculateRadiiAndCenter

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

        SVGLengthContext lengthContext(circle);
        float radius = circle->r()->currentValue()->value(lengthContext);
        m_radii = FloatSize(radius, radius);
        m_center = FloatPoint(circle->cx()->currentValue()->value(lengthContext), circle->cy()->currentValue()->value(lengthContext));
        return;
    }

    SVGEllipseElement* ellipse = toSVGEllipseElement(element());

    SVGLengthContext lengthContext(ellipse);
    m_radii = FloatSize(ellipse->rx()->currentValue()->value(lengthContext), ellipse->ry()->currentValue()->value(lengthContext));
    m_center = FloatPoint(ellipse->cx()->currentValue()->value(lengthContext), ellipse->cy()->currentValue()->value(lengthContext));
}
开发者ID:glenkim-dev,项目名称:blink-crosswalk,代码行数:19,代码来源:RenderSVGEllipse.cpp

示例5: calculateRadiiAndCenter

void RenderSVGEllipse::calculateRadiiAndCenter()
{
    ASSERT(element());
    if (isSVGCircleElement(element())) {

        SVGCircleElement* circle = toSVGCircleElement(element());

        SVGLengthContext lengthContext(circle);
        float radius = circle->r().value(lengthContext);
        m_radii = FloatSize(radius, radius);
        m_center = FloatPoint(circle->cx().value(lengthContext), circle->cy().value(lengthContext));
        return;
    }

    ASSERT(isSVGEllipseElement(element()));
    SVGEllipseElement* ellipse = toSVGEllipseElement(element());

    SVGLengthContext lengthContext(ellipse);
    m_radii = FloatSize(ellipse->rx().value(lengthContext), ellipse->ry().value(lengthContext));
    m_center = FloatPoint(ellipse->cx().value(lengthContext), ellipse->cy().value(lengthContext));
}
开发者ID:,项目名称:,代码行数:21,代码来源:


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