Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGAnimateMotionElement.cpp

Issue 1418663004: SVG animateMotion paths that only cause offsets are no longer ignored (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.cpp ('k') | third_party/WebKit/Source/platform/graphics/Path.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698