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

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

Issue 141273002: Code problems detected by cppcheck (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 years, 11 months 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
« no previous file with comments | « Source/core/rendering/svg/SVGTextQuery.cpp ('k') | Source/core/xml/XPathFunctions.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 270
271 float animatedY = 0; 271 float animatedY = 0;
272 animateAdditiveNumber(percentage, repeatCount, m_fromPoint.y(), m_toPoin t.y(), toPointAtEndOfDuration.y(), animatedY); 272 animateAdditiveNumber(percentage, repeatCount, m_fromPoint.y(), m_toPoin t.y(), toPointAtEndOfDuration.y(), animatedY);
273 273
274 transform->translate(animatedX, animatedY); 274 transform->translate(animatedX, animatedY);
275 return; 275 return;
276 } 276 }
277 277
278 ASSERT(!m_animationPath.isEmpty()); 278 ASSERT(!m_animationPath.isEmpty());
279 279
280 bool ok = false;
281 float positionOnPath = m_animationPath.length() * percentage; 280 float positionOnPath = m_animationPath.length() * percentage;
282 FloatPoint position; 281 FloatPoint position;
283 float angle; 282 float angle;
284 ok = m_animationPath.pointAndNormalAtLength(positionOnPath, position, angle) ; 283 bool ok = m_animationPath.pointAndNormalAtLength(positionOnPath, position, a ngle);
285 if (!ok) 284 if (!ok)
286 return; 285 return;
287 286
288 // Handle accumulate="sum". 287 // Handle accumulate="sum".
289 if (isAccumulated() && repeatCount) { 288 if (isAccumulated() && repeatCount) {
290 FloatPoint positionAtEndOfDuration = m_animationPath.pointAtLength(m_ani mationPath.length(), ok); 289 FloatPoint positionAtEndOfDuration = m_animationPath.pointAtLength(m_ani mationPath.length(), ok);
291 if (ok) 290 if (ok)
292 position.move(positionAtEndOfDuration.x() * repeatCount, positionAtE ndOfDuration.y() * repeatCount); 291 position.move(positionAtEndOfDuration.x() * repeatCount, positionAtE ndOfDuration.y() * repeatCount);
293 } 292 }
294 293
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 345
347 void SVGAnimateMotionElement::updateAnimationMode() 346 void SVGAnimateMotionElement::updateAnimationMode()
348 { 347 {
349 if (!m_animationPath.isEmpty()) 348 if (!m_animationPath.isEmpty())
350 setAnimationMode(PathAnimation); 349 setAnimationMode(PathAnimation);
351 else 350 else
352 SVGAnimationElement::updateAnimationMode(); 351 SVGAnimationElement::updateAnimationMode();
353 } 352 }
354 353
355 } 354 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGTextQuery.cpp ('k') | Source/core/xml/XPathFunctions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698