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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 inline SVGPathElement::SVGPathElement(Document& document) | 58 inline SVGPathElement::SVGPathElement(Document& document) |
59 : SVGGeometryElement(SVGNames::pathTag, document) | 59 : SVGGeometryElement(SVGNames::pathTag, document) |
60 , m_pathLength(SVGAnimatedNumber::create(this, SVGNames::pathLengthAttr, SVG
Number::create())) | 60 , m_pathLength(SVGAnimatedNumber::create(this, SVGNames::pathLengthAttr, SVG
Number::create())) |
61 , m_pathSegList(SVGAnimatedPath::create(this, SVGNames::dAttr)) | 61 , m_pathSegList(SVGAnimatedPath::create(this, SVGNames::dAttr)) |
62 { | 62 { |
63 ScriptWrappable::init(this); | 63 ScriptWrappable::init(this); |
64 | 64 |
65 addToPropertyMap(m_pathLength); | 65 addToPropertyMap(m_pathLength); |
66 addToPropertyMap(m_pathSegList); | 66 addToPropertyMap(m_pathSegList); |
67 registerAnimatedPropertiesForSVGPathElement(); | |
68 } | 67 } |
69 | 68 |
70 PassRefPtr<SVGPathElement> SVGPathElement::create(Document& document) | 69 PassRefPtr<SVGPathElement> SVGPathElement::create(Document& document) |
71 { | 70 { |
72 return adoptRef(new SVGPathElement(document)); | 71 return adoptRef(new SVGPathElement(document)); |
73 } | 72 } |
74 | 73 |
75 float SVGPathElement::getTotalLength() | 74 float SVGPathElement::getTotalLength() |
76 { | 75 { |
77 float totalLength = 0; | 76 float totalLength = 0; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 290 |
292 // FIXME: Eventually we should support getBBox for detached elements. | 291 // FIXME: Eventually we should support getBBox for detached elements. |
293 if (!renderer()) | 292 if (!renderer()) |
294 return FloatRect(); | 293 return FloatRect(); |
295 | 294 |
296 RenderSVGPath* renderer = toRenderSVGPath(this->renderer()); | 295 RenderSVGPath* renderer = toRenderSVGPath(this->renderer()); |
297 return renderer->path().boundingRect(); | 296 return renderer->path().boundingRect(); |
298 } | 297 } |
299 | 298 |
300 } | 299 } |
OLD | NEW |