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) { |
260 bool ok; | |
262 FloatPoint positionAtEndOfDuration = m_animationPath.pointAtLength(m_ani mationPath.length(), ok); | 261 FloatPoint positionAtEndOfDuration = m_animationPath.pointAtLength(m_ani mationPath.length(), ok); |
pdr.
2015/10/30 00:52:05
pointAtLength just calls pointAndNormalAtLength in
Eric Willigers
2015/11/20 07:49:53
Updated.
animateMotion-still.html now tests this
| |
263 if (ok) | 262 if (ok) |
264 position.move(positionAtEndOfDuration.x() * repeatCount, positionAtE ndOfDuration.y() * repeatCount); | 263 position.move(positionAtEndOfDuration.x() * repeatCount, positionAtE ndOfDuration.y() * repeatCount); |
265 } | 264 } |
266 | 265 |
267 transform->translate(position.x(), position.y()); | 266 transform->translate(position.x(), position.y()); |
268 RotateMode rotateMode = this->rotateMode(); | 267 RotateMode rotateMode = this->rotateMode(); |
269 if (rotateMode != RotateAuto && rotateMode != RotateAutoReverse) | 268 if (rotateMode != RotateAuto && rotateMode != RotateAutoReverse) |
270 return; | 269 return; |
271 if (rotateMode == RotateAutoReverse) | 270 if (rotateMode == RotateAutoReverse) |
272 angle += 180; | 271 angle += 180; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
316 | 315 |
317 void SVGAnimateMotionElement::updateAnimationMode() | 316 void SVGAnimateMotionElement::updateAnimationMode() |
318 { | 317 { |
319 if (!m_animationPath.isEmpty()) | 318 if (!m_animationPath.isEmpty()) |
320 setAnimationMode(PathAnimation); | 319 setAnimationMode(PathAnimation); |
321 else | 320 else |
322 SVGAnimationElement::updateAnimationMode(); | 321 SVGAnimationElement::updateAnimationMode(); |
323 } | 322 } |
324 | 323 |
325 } | 324 } |
OLD | NEW |