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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) | 213 void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) |
214 { | 214 { |
215 if (!isSupportedAttribute(attrName)) { | 215 if (!isSupportedAttribute(attrName)) { |
216 SVGGeometryElement::svgAttributeChanged(attrName); | 216 SVGGeometryElement::svgAttributeChanged(attrName); |
217 return; | 217 return; |
218 } | 218 } |
219 | 219 |
220 SVGElement::InvalidationGuard invalidationGuard(this); | 220 SVGElement::InvalidationGuard invalidationGuard(this); |
221 | 221 |
222 RenderSVGPath* renderer = toRenderSVGPath(this->renderer()); | 222 RenderSVGShape* renderer = toRenderSVGShape(this->renderer()); |
223 | 223 |
224 if (attrName == SVGNames::dAttr) { | 224 if (attrName == SVGNames::dAttr) { |
225 if (renderer) | 225 if (renderer) |
226 renderer->setNeedsShapeUpdate(); | 226 renderer->setNeedsShapeUpdate(); |
227 | 227 |
228 invalidateMPathDependencies(); | 228 invalidateMPathDependencies(); |
229 } | 229 } |
230 | 230 |
231 if (renderer) | 231 if (renderer) |
232 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); | 232 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); |
(...skipping 24 matching lines...) Expand all Loading... |
257 SVGGeometryElement::removedFrom(rootParent); | 257 SVGGeometryElement::removedFrom(rootParent); |
258 invalidateMPathDependencies(); | 258 invalidateMPathDependencies(); |
259 } | 259 } |
260 | 260 |
261 void SVGPathElement::pathSegListChanged(ListModification listModification) | 261 void SVGPathElement::pathSegListChanged(ListModification listModification) |
262 { | 262 { |
263 m_pathSegList->baseValue()->clearByteStream(); | 263 m_pathSegList->baseValue()->clearByteStream(); |
264 | 264 |
265 invalidateSVGAttributes(); | 265 invalidateSVGAttributes(); |
266 | 266 |
267 RenderSVGPath* renderer = toRenderSVGPath(this->renderer()); | 267 RenderSVGShape* renderer = toRenderSVGShape(this->renderer()); |
268 if (!renderer) | 268 if (!renderer) |
269 return; | 269 return; |
270 | 270 |
271 renderer->setNeedsShapeUpdate(); | 271 renderer->setNeedsShapeUpdate(); |
272 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); | 272 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); |
273 } | 273 } |
274 | 274 |
275 FloatRect SVGPathElement::getBBox() | 275 FloatRect SVGPathElement::getBBox() |
276 { | 276 { |
277 // By default, getBBox() returns objectBoundingBox but that will include | 277 // By default, getBBox() returns objectBoundingBox but that will include |
278 // markers so we override it to return just the path's bounding rect. | 278 // markers so we override it to return just the path's bounding rect. |
279 | 279 |
280 document().updateLayoutIgnorePendingStylesheets(); | 280 document().updateLayoutIgnorePendingStylesheets(); |
281 | 281 |
282 // FIXME: Eventually we should support getBBox for detached elements. | 282 // FIXME: Eventually we should support getBBox for detached elements. |
283 if (!renderer()) | 283 if (!renderer()) |
284 return FloatRect(); | 284 return FloatRect(); |
285 | 285 |
286 RenderSVGPath* renderer = toRenderSVGPath(this->renderer()); | 286 RenderSVGShape* renderer = toRenderSVGShape(this->renderer()); |
287 return renderer->path().boundingRect(); | 287 return renderer->path().boundingRect(); |
288 } | 288 } |
289 | 289 |
290 } | 290 } |
OLD | NEW |