Example #1
0
void SVGGeometryElement::toClipPath(Path& path) const {
  path = asPath();
  path.transform(calculateAnimatedLocalTransform());

  ASSERT(layoutObject());
  ASSERT(layoutObject()->style());
  path.setWindRule(layoutObject()->style()->svgStyle().clipRule());
}
void SVGUseElement::toClipPath(Path& path) const
{
    ASSERT(path.isEmpty());

    const SVGGraphicsElement* element = targetGraphicsElementForClipping();

    if (!element)
        return;

    if (element->isSVGGeometryElement()) {
        toSVGGeometryElement(*element).toClipPath(path);
        // FIXME: Avoid manual resolution of x/y here. Its potentially harmful.
        SVGLengthContext lengthContext(this);
        path.translate(FloatSize(m_x->currentValue()->value(lengthContext), m_y->currentValue()->value(lengthContext)));
        path.transform(calculateAnimatedLocalTransform());
    }
}