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 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 arguments[argumentCount++] = m_matrix.a(); | 172 arguments[argumentCount++] = m_matrix.a(); |
173 arguments[argumentCount++] = m_matrix.d(); | 173 arguments[argumentCount++] = m_matrix.d(); |
174 break; | 174 break; |
175 } | 175 } |
176 case kSvgTransformRotate: { | 176 case kSvgTransformRotate: { |
177 arguments[argumentCount++] = m_angle; | 177 arguments[argumentCount++] = m_angle; |
178 | 178 |
179 double angleInRad = deg2rad(m_angle); | 179 double angleInRad = deg2rad(m_angle); |
180 double cosAngle = cos(angleInRad); | 180 double cosAngle = cos(angleInRad); |
181 double sinAngle = sin(angleInRad); | 181 double sinAngle = sin(angleInRad); |
182 float cx = clampTo<float>( | 182 float cx = clampTo<float>(cosAngle != 1 ? (m_matrix.e() * (1 - cosAngle) - |
183 cosAngle != 1 | 183 m_matrix.f() * sinAngle) / |
184 ? (m_matrix.e() * (1 - cosAngle) - m_matrix.f() * sinAngle) / | 184 (1 - cosAngle) / 2 |
185 (1 - cosAngle) / 2 | 185 : 0); |
186 : 0); | |
187 float cy = clampTo<float>( | 186 float cy = clampTo<float>( |
188 cosAngle != 1 | 187 cosAngle != 1 |
189 ? (m_matrix.e() * sinAngle / (1 - cosAngle) + m_matrix.f()) / 2 | 188 ? (m_matrix.e() * sinAngle / (1 - cosAngle) + m_matrix.f()) / 2 |
190 : 0); | 189 : 0); |
191 if (cx || cy) { | 190 if (cx || cy) { |
192 arguments[argumentCount++] = cx; | 191 arguments[argumentCount++] = cx; |
193 arguments[argumentCount++] = cy; | 192 arguments[argumentCount++] = cy; |
194 } | 193 } |
195 break; | 194 break; |
196 } | 195 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 } | 231 } |
233 | 232 |
234 float SVGTransform::calculateDistance(SVGPropertyBase*, SVGElement*) { | 233 float SVGTransform::calculateDistance(SVGPropertyBase*, SVGElement*) { |
235 // SVGTransform is not animated by itself. | 234 // SVGTransform is not animated by itself. |
236 ASSERT_NOT_REACHED(); | 235 ASSERT_NOT_REACHED(); |
237 | 236 |
238 return -1; | 237 return -1; |
239 } | 238 } |
240 | 239 |
241 } // namespace blink | 240 } // namespace blink |
OLD | NEW |