コード例 #1
0
void LayoutSVGShape::createPath()
{
    clearPath();
    m_path = adoptPtr(new Path);
    ASSERT(LayoutSVGShape::isShapeEmpty());

    updatePathFromGraphicsElement(toSVGGraphicsElement(element()), path());
}
コード例 #2
0
ファイル: RenderSVGShape.cpp プロジェクト: Moondee/Artemis
void RenderSVGShape::createShape()
{
    ASSERT(!m_path);
    m_path = adoptPtr(new Path);
    ASSERT(isEmpty());

    SVGPathElement* element = static_cast<SVGPathElement*>(node());
    updatePathFromGraphicsElement(element, path());
    processZeroLengthSubpaths();
}
コード例 #3
0
ファイル: RenderSVGShape.cpp プロジェクト: kamihouse/webkit
void RenderSVGShape::updateShapeFromElement()
{
    m_path = std::make_unique<Path>();
    ASSERT(RenderSVGShape::isEmpty());

    updatePathFromGraphicsElement(&graphicsElement(), path());
    processMarkerPositions();

    m_fillBoundingBox = calculateObjectBoundingBox();
    m_strokeBoundingBox = calculateStrokeBoundingBox();
}
コード例 #4
0
void RenderSVGShape::updateShapeFromElement()
{
    m_path.clear();
    m_path = adoptPtr(new Path);
    ASSERT(RenderSVGShape::isEmpty());

    updatePathFromGraphicsElement(&graphicsElement(), path());
    processMarkerPositions();

    m_fillBoundingBox = calculateObjectBoundingBox();
    m_strokeBoundingBox = calculateStrokeBoundingBox();
}
コード例 #5
0
ファイル: RenderSVGShape.cpp プロジェクト: windyuuy/opera
void RenderSVGShape::updateShapeFromElement()
{
    m_path.clear();
    m_path = adoptPtr(new Path);
    ASSERT(RenderSVGShape::isEmpty());

    SVGStyledTransformableElement* element = toSVGStyledTransformableElement(node());
    updatePathFromGraphicsElement(element, path());
    processMarkerPositions();

    m_fillBoundingBox = calculateObjectBoundingBox();
    m_strokeBoundingBox = calculateStrokeBoundingBox();
}
コード例 #6
0
Path RenderSVGTextPath::layoutPath() const
{
    Element* targetElement = SVGURIReference::targetElementFromIRIString(textPathElement().href(), document());
    if (!targetElement || !targetElement->hasTagName(SVGNames::pathTag))
        return Path();
    
    SVGPathElement* pathElement = toSVGPathElement(targetElement);
    
    Path pathData;
    updatePathFromGraphicsElement(pathElement, pathData);

    // Spec:  The transform attribute on the referenced 'path' element represents a
    // supplemental transformation relative to the current user coordinate system for
    // the current 'text' element, including any adjustments to the current user coordinate
    // system due to a possible transform attribute on the current 'text' element.
    // http://www.w3.org/TR/SVG/text.html#TextPathElement
    pathData.transform(pathElement->animatedLocalTransform());
    return pathData;
}
コード例 #7
0
void SVGAnimateMotionElement::updateAnimationPath()
{
    m_animationPath = Path();
    bool foundMPath = false;

    for (auto& mPath : childrenOfType<SVGMPathElement>(*this)) {
        SVGPathElement* pathElement = mPath.pathElement();
        if (pathElement) {
            updatePathFromGraphicsElement(pathElement, m_animationPath);
            foundMPath = true;
            break;
        }
    }

    if (!foundMPath && fastHasAttribute(SVGNames::pathAttr))
        m_animationPath = m_path;

    updateAnimationMode();
}
コード例 #8
0
ファイル: RenderSVGTextPath.cpp プロジェクト: kjthegod/WebKit
Path RenderSVGTextPath::layoutPath() const
{
    SVGTextPathElement* textPathElement = toSVGTextPathElement(node());
    Element* targetElement = SVGURIReference::targetElementFromIRIString(textPathElement->href()->currentValue()->value(), textPathElement->treeScope());
    if (!isSVGPathElement(targetElement))
        return Path();

    SVGPathElement& pathElement = toSVGPathElement(*targetElement);

    Path pathData;
    updatePathFromGraphicsElement(&pathElement, pathData);

    // Spec:  The transform attribute on the referenced 'path' element represents a
    // supplemental transformation relative to the current user coordinate system for
    // the current 'text' element, including any adjustments to the current user coordinate
    // system due to a possible transform attribute on the current 'text' element.
    // http://www.w3.org/TR/SVG/text.html#TextPathElement
    pathData.transform(pathElement.calculateAnimatedLocalTransform());
    return pathData;
}
コード例 #9
0
void SVGGraphicsElement::toClipPath(Path& path)
{
    updatePathFromGraphicsElement(this, path);
    // FIXME: How do we know the element has done a layout?
    path.transform(animatedLocalTransform());
}