OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 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) 2009 Google, Inc. | 4 * Copyright (C) 2009 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 SVGUseElement* useElement = nullptr; | 83 SVGUseElement* useElement = nullptr; |
84 if (isSVGUseElement(*element)) { | 84 if (isSVGUseElement(*element)) { |
85 useElement = toSVGUseElement(element); | 85 useElement = toSVGUseElement(element); |
86 } else if (isSVGGElement(*element) && toSVGGElement(element)->inUseShadowTre
e()) { | 86 } else if (isSVGGElement(*element) && toSVGGElement(element)->inUseShadowTre
e()) { |
87 SVGElement* correspondingElement = element->correspondingElement(); | 87 SVGElement* correspondingElement = element->correspondingElement(); |
88 if (isSVGUseElement(correspondingElement)) | 88 if (isSVGUseElement(correspondingElement)) |
89 useElement = toSVGUseElement(correspondingElement); | 89 useElement = toSVGUseElement(correspondingElement); |
90 } | 90 } |
91 | 91 |
92 if (useElement) { | 92 if (useElement) { |
93 SVGLengthContext lengthContext(useElement); | 93 SVGLengthContext lengthContext(element); |
94 FloatSize translation( | 94 FloatSize translation( |
95 useElement->x()->currentValue()->value(lengthContext), | 95 useElement->x()->currentValue()->value(lengthContext), |
96 useElement->y()->currentValue()->value(lengthContext)); | 96 useElement->y()->currentValue()->value(lengthContext)); |
97 // TODO(fs): Signal this on style update instead. (Since these are | 97 // TODO(fs): Signal this on style update instead. (Since these are |
98 // suppose to be presentation attributes now, this does feel a bit | 98 // suppose to be presentation attributes now, this does feel a bit |
99 // broken...) | 99 // broken...) |
100 if (translation != m_additionalTranslation) | 100 if (translation != m_additionalTranslation) |
101 setNeedsTransformUpdate(); | 101 setNeedsTransformUpdate(); |
102 m_additionalTranslation = translation; | 102 m_additionalTranslation = translation; |
103 } | 103 } |
104 | 104 |
105 if (!m_needsTransformUpdate) | 105 if (!m_needsTransformUpdate) |
106 return SVGTransformChange::None; | 106 return SVGTransformChange::None; |
107 | 107 |
108 SVGTransformChangeDetector changeDetector(m_localTransform); | 108 SVGTransformChangeDetector changeDetector(m_localTransform); |
109 m_localTransform = element->calculateAnimatedLocalTransform(); | 109 m_localTransform = element->calculateAnimatedLocalTransform(); |
110 m_localTransform.translate(m_additionalTranslation.width(), m_additionalTran
slation.height()); | 110 m_localTransform.translate(m_additionalTranslation.width(), m_additionalTran
slation.height()); |
111 m_needsTransformUpdate = false; | 111 m_needsTransformUpdate = false; |
112 return changeDetector.computeChange(m_localTransform); | 112 return changeDetector.computeChange(m_localTransform); |
113 } | 113 } |
114 | 114 |
115 } // namespace blink | 115 } // namespace blink |
OLD | NEW |