OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 { | 74 { |
75 // If this is a <use> instance, return the referenced path to maximize geome
try sharing. | 75 // If this is a <use> instance, return the referenced path to maximize geome
try sharing. |
76 if (const SVGElement* element = correspondingElement()) | 76 if (const SVGElement* element = correspondingElement()) |
77 return toSVGPathElement(element)->asPath(); | 77 return toSVGPathElement(element)->asPath(); |
78 | 78 |
79 return m_path->currentValue()->path(); | 79 return m_path->currentValue()->path(); |
80 } | 80 } |
81 | 81 |
82 float SVGPathElement::getTotalLength() | 82 float SVGPathElement::getTotalLength() |
83 { | 83 { |
84 return SVGPathQuery(pathByteStream()).getTotalLength(); | 84 return SVGPathQuery(m_path->currentValue()->byteStream()).getTotalLength(); |
85 } | 85 } |
86 | 86 |
87 PassRefPtrWillBeRawPtr<SVGPointTearOff> SVGPathElement::getPointAtLength(float l
ength) | 87 PassRefPtrWillBeRawPtr<SVGPointTearOff> SVGPathElement::getPointAtLength(float l
ength) |
88 { | 88 { |
89 FloatPoint point = SVGPathQuery(pathByteStream()).getPointAtLength(length); | 89 FloatPoint point = SVGPathQuery(m_path->currentValue()->byteStream()).getPoi
ntAtLength(length); |
90 return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnim
Val); | 90 return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnim
Val); |
91 } | 91 } |
92 | 92 |
93 unsigned SVGPathElement::getPathSegAtLength(float length) | 93 unsigned SVGPathElement::getPathSegAtLength(float length) |
94 { | 94 { |
95 return SVGPathQuery(pathByteStream()).getPathSegIndexAtLength(length); | 95 return SVGPathQuery(m_path->currentValue()->byteStream()).getPathSegIndexAtL
ength(length); |
96 } | 96 } |
97 | 97 |
98 void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) | 98 void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) |
99 { | 99 { |
100 if (attrName == SVGNames::dAttr || attrName == SVGNames::pathLengthAttr) { | 100 if (attrName == SVGNames::dAttr || attrName == SVGNames::pathLengthAttr) { |
101 SVGElement::InvalidationGuard invalidationGuard(this); | 101 SVGElement::InvalidationGuard invalidationGuard(this); |
102 | 102 |
103 LayoutSVGShape* layoutObject = toLayoutSVGShape(this->layoutObject()); | 103 LayoutSVGShape* layoutObject = toLayoutSVGShape(this->layoutObject()); |
104 | 104 |
105 if (attrName == SVGNames::dAttr) { | 105 if (attrName == SVGNames::dAttr) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return InsertionDone; | 137 return InsertionDone; |
138 } | 138 } |
139 | 139 |
140 void SVGPathElement::removedFrom(ContainerNode* rootParent) | 140 void SVGPathElement::removedFrom(ContainerNode* rootParent) |
141 { | 141 { |
142 SVGGeometryElement::removedFrom(rootParent); | 142 SVGGeometryElement::removedFrom(rootParent); |
143 invalidateMPathDependencies(); | 143 invalidateMPathDependencies(); |
144 } | 144 } |
145 | 145 |
146 } // namespace blink | 146 } // namespace blink |
OLD | NEW |