本文整理汇总了C++中SVGEllipseElement::ryCurrentValue方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGEllipseElement::ryCurrentValue方法的具体用法?C++ SVGEllipseElement::ryCurrentValue怎么用?C++ SVGEllipseElement::ryCurrentValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGEllipseElement
的用法示例。
在下文中一共展示了SVGEllipseElement::ryCurrentValue方法的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));
}
示例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;
}