OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2014 Google, Inc. | 4 * Copyright (C) 2014 Google, Inc. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 PassRefPtr<SVGMatrixTearOff> SVGGraphicsElement::getCTMFromJavascript() | 115 PassRefPtr<SVGMatrixTearOff> SVGGraphicsElement::getCTMFromJavascript() |
116 { | 116 { |
117 return SVGMatrixTearOff::create(getCTM()); | 117 return SVGMatrixTearOff::create(getCTM()); |
118 } | 118 } |
119 | 119 |
120 PassRefPtr<SVGMatrixTearOff> SVGGraphicsElement::getScreenCTMFromJavascript() | 120 PassRefPtr<SVGMatrixTearOff> SVGGraphicsElement::getScreenCTMFromJavascript() |
121 { | 121 { |
122 return SVGMatrixTearOff::create(getScreenCTM()); | 122 return SVGMatrixTearOff::create(getScreenCTM()); |
123 } | 123 } |
124 | 124 |
125 bool SVGGraphicsElement::hasAnimatedLocalTransform() const | |
126 { | |
127 RenderStyle* style = renderer() ? renderer()->style() : 0; | |
128 return (style && style->hasTransform()) || !m_transform->currentValue()->isE mpty() || hasSVGRareData(); | |
fs
2014/11/05 13:46:47
Maybe there ought to be a comment here pointing to
pdr.
2014/11/07 04:20:27
Excellent point. Done
| |
129 } | |
130 | |
125 AffineTransform SVGGraphicsElement::calculateAnimatedLocalTransform() const | 131 AffineTransform SVGGraphicsElement::calculateAnimatedLocalTransform() const |
126 { | 132 { |
127 AffineTransform matrix; | 133 AffineTransform matrix; |
128 RenderStyle* style = renderer() ? renderer()->style() : 0; | 134 RenderStyle* style = renderer() ? renderer()->style() : 0; |
129 | 135 |
130 // If CSS property was set, use that, otherwise fallback to attribute (if se t). | 136 // If CSS property was set, use that, otherwise fallback to attribute (if se t). |
131 if (style && style->hasTransform()) { | 137 if (style && style->hasTransform()) { |
132 TransformationMatrix transform; | 138 TransformationMatrix transform; |
133 float zoom = style->effectiveZoom(); | 139 float zoom = style->effectiveZoom(); |
134 | 140 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 return new RenderSVGPath(this); | 263 return new RenderSVGPath(this); |
258 } | 264 } |
259 | 265 |
260 void SVGGraphicsElement::toClipPath(Path& path) | 266 void SVGGraphicsElement::toClipPath(Path& path) |
261 { | 267 { |
262 updatePathFromGraphicsElement(this, path); | 268 updatePathFromGraphicsElement(this, path); |
263 path.transform(calculateAnimatedLocalTransform()); | 269 path.transform(calculateAnimatedLocalTransform()); |
264 } | 270 } |
265 | 271 |
266 } | 272 } |
OLD | NEW |