OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2008 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 30 matching lines...) Expand all Loading... |
41 { | 41 { |
42 return adoptRef(new SVGTextElement(tagName, document)); | 42 return adoptRef(new SVGTextElement(tagName, document)); |
43 } | 43 } |
44 | 44 |
45 // We override SVGGraphics::animatedLocalTransform() so that the transform-origi
n | 45 // We override SVGGraphics::animatedLocalTransform() so that the transform-origi
n |
46 // is not taken into account. | 46 // is not taken into account. |
47 AffineTransform SVGTextElement::animatedLocalTransform() const | 47 AffineTransform SVGTextElement::animatedLocalTransform() const |
48 { | 48 { |
49 AffineTransform matrix; | 49 AffineTransform matrix; |
50 RenderStyle* style = renderer() ? renderer()->style() : 0; | 50 RenderStyle* style = renderer() ? renderer()->style() : 0; |
| 51 RenderView* renderView = renderer() ? renderer()->view() : 0; |
51 | 52 |
52 // if CSS property was set, use that, otherwise fallback to attribute (if se
t) | 53 // if CSS property was set, use that, otherwise fallback to attribute (if se
t) |
53 if (style && style->hasTransform()) { | 54 if (style && style->hasTransform()) { |
54 TransformationMatrix t; | 55 TransformationMatrix t; |
55 // For now, the transform-origin is not taken into account | 56 // For now, the transform-origin is not taken into account |
56 // Also, any percentage values will not be taken into account | 57 // Also, any percentage values will not be taken into account |
57 style->applyTransform(t, IntSize(0, 0), RenderStyle::ExcludeTransformOri
gin); | 58 style->applyTransform(t, IntSize(0, 0), RenderStyle::ExcludeTransformOri
gin, renderView); |
58 // Flatten any 3D transform | 59 // Flatten any 3D transform |
59 matrix = t.toAffineTransform(); | 60 matrix = t.toAffineTransform(); |
60 } else { | 61 } else { |
61 transformCurrentValue().concatenate(matrix); | 62 transformCurrentValue().concatenate(matrix); |
62 } | 63 } |
63 | 64 |
64 const AffineTransform* transform = const_cast<SVGTextElement*>(this)->supple
mentalTransform(); | 65 const AffineTransform* transform = const_cast<SVGTextElement*>(this)->supple
mentalTransform(); |
65 if (transform) | 66 if (transform) |
66 return *transform * matrix; | 67 return *transform * matrix; |
67 return matrix; | 68 return matrix; |
(...skipping 13 matching lines...) Expand all Loading... |
81 #endif | 82 #endif |
82 || childContext.node()->hasTagName(SVGNames::textPathTag) | 83 || childContext.node()->hasTagName(SVGNames::textPathTag) |
83 || childContext.node()->hasTagName(SVGNames::trefTag) | 84 || childContext.node()->hasTagName(SVGNames::trefTag) |
84 || childContext.node()->hasTagName(SVGNames::tspanTag)) | 85 || childContext.node()->hasTagName(SVGNames::tspanTag)) |
85 return true; | 86 return true; |
86 | 87 |
87 return false; | 88 return false; |
88 } | 89 } |
89 | 90 |
90 } | 91 } |
OLD | NEW |