| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 3 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) 2008 Apple Inc. All rights reserved. | 4 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 246 |
| 247 transform->translate(animatedX, animatedY); | 247 transform->translate(animatedX, animatedY); |
| 248 return; | 248 return; |
| 249 } | 249 } |
| 250 | 250 |
| 251 ASSERT(!m_animationPath.isEmpty()); | 251 ASSERT(!m_animationPath.isEmpty()); |
| 252 | 252 |
| 253 float positionOnPath = m_animationPath.length() * percentage; | 253 float positionOnPath = m_animationPath.length() * percentage; |
| 254 FloatPoint position; | 254 FloatPoint position; |
| 255 float angle; | 255 float angle; |
| 256 bool ok = m_animationPath.pointAndNormalAtLength(positionOnPath, position, a
ngle); | 256 m_animationPath.pointAndNormalAtLength(positionOnPath, position, angle); |
| 257 if (!ok) | |
| 258 return; | |
| 259 | 257 |
| 260 // Handle accumulate="sum". | 258 // Handle accumulate="sum". |
| 261 if (isAccumulated() && repeatCount) { | 259 if (isAccumulated() && repeatCount) { |
| 262 FloatPoint positionAtEndOfDuration = m_animationPath.pointAtLength(m_ani
mationPath.length(), ok); | 260 FloatPoint positionAtEndOfDuration = m_animationPath.pointAtLength(m_ani
mationPath.length()); |
| 263 if (ok) | 261 position.move(positionAtEndOfDuration.x() * repeatCount, positionAtEndOf
Duration.y() * repeatCount); |
| 264 position.move(positionAtEndOfDuration.x() * repeatCount, positionAtE
ndOfDuration.y() * repeatCount); | |
| 265 } | 262 } |
| 266 | 263 |
| 267 transform->translate(position.x(), position.y()); | 264 transform->translate(position.x(), position.y()); |
| 268 RotateMode rotateMode = this->rotateMode(); | 265 RotateMode rotateMode = this->rotateMode(); |
| 269 if (rotateMode != RotateAuto && rotateMode != RotateAutoReverse) | 266 if (rotateMode != RotateAuto && rotateMode != RotateAutoReverse) |
| 270 return; | 267 return; |
| 271 if (rotateMode == RotateAutoReverse) | 268 if (rotateMode == RotateAutoReverse) |
| 272 angle += 180; | 269 angle += 180; |
| 273 transform->rotate(angle); | 270 transform->rotate(angle); |
| 274 } | 271 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 313 |
| 317 void SVGAnimateMotionElement::updateAnimationMode() | 314 void SVGAnimateMotionElement::updateAnimationMode() |
| 318 { | 315 { |
| 319 if (!m_animationPath.isEmpty()) | 316 if (!m_animationPath.isEmpty()) |
| 320 setAnimationMode(PathAnimation); | 317 setAnimationMode(PathAnimation); |
| 321 else | 318 else |
| 322 SVGAnimationElement::updateAnimationMode(); | 319 SVGAnimationElement::updateAnimationMode(); |
| 323 } | 320 } |
| 324 | 321 |
| 325 } | 322 } |
| OLD | NEW |