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

Unified Diff: Source/core/svg/SVGAnimateMotionElement.cpp

Issue 18436004: [SVG] animateMotion accumulate doesn't work properly with rotate: auto / auto-reverse (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/svg/animations/animateMotion-accumulate-2b-expected.svg ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGAnimateMotionElement.cpp
diff --git a/Source/core/svg/SVGAnimateMotionElement.cpp b/Source/core/svg/SVGAnimateMotionElement.cpp
index 23ede7ddd4f87aedf666c735aa2088d1fa93a5e2..86fc66111512d3600d54f0a594a948a9bc31b335 100644
--- a/Source/core/svg/SVGAnimateMotionElement.cpp
+++ b/Source/core/svg/SVGAnimateMotionElement.cpp
@@ -237,18 +237,10 @@ void SVGAnimateMotionElement::buildTransformForProgress(AffineTransform* transfo
bool ok = false;
float positionOnPath = m_animationPath.length() * percentage;
- FloatPoint position;
- float angle;
- ok = m_animationPath.pointAndNormalAtLength(positionOnPath, position, angle);
+ FloatPoint position = m_animationPath.pointAtLength(positionOnPath, ok);
if (!ok)
return;
transform->translate(position.x(), position.y());
- RotateMode rotateMode = this->rotateMode();
- if (rotateMode != RotateAuto && rotateMode != RotateAutoReverse)
- return;
- if (rotateMode == RotateAutoReverse)
- angle += 180;
- transform->rotate(angle);
}
void SVGAnimateMotionElement::calculateAnimatedValue(float percentage, unsigned repeatCount, SVGSMILElement*)
@@ -288,6 +280,18 @@ void SVGAnimateMotionElement::calculateAnimatedValue(float percentage, unsigned
for (unsigned i = 0; i < repeatCount; ++i)
buildTransformForProgress(transform, 1);
}
+
+ bool ok = false;
+ float positionOnPath = m_animationPath.length() * percentage;
+ float angle = m_animationPath.normalAngleAtLength(positionOnPath, ok);
+ if (!ok)
+ return;
+ RotateMode rotateMode = this->rotateMode();
+ if (rotateMode != RotateAuto && rotateMode != RotateAutoReverse)
+ return;
+ if (rotateMode == RotateAutoReverse)
+ angle += 180;
+ transform->rotate(angle);
}
void SVGAnimateMotionElement::applyResultsToTarget()
« no previous file with comments | « LayoutTests/svg/animations/animateMotion-accumulate-2b-expected.svg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698