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

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

Issue 1017703002: Normalize targetPoint first in parseArcToSegment (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGPathParser.cpp
diff --git a/Source/core/svg/SVGPathParser.cpp b/Source/core/svg/SVGPathParser.cpp
index 261df8aebede839884bdc4e68040e9d0ffa5ae66..6d9fe45ef132e51e00cd902d7b9bd4052ffefa72 100644
--- a/Source/core/svg/SVGPathParser.cpp
+++ b/Source/core/svg/SVGPathParser.cpp
@@ -257,23 +257,17 @@ bool SVGPathParser::parseArcToSegment()
// path. This ensures continuity in animations.
rx = fabsf(rx);
ry = fabsf(ry);
- bool arcIsZeroLength = false;
+
if (m_mode == RelativeCoordinates)
- arcIsZeroLength = targetPoint == FloatPoint::zero();
- else
- arcIsZeroLength = targetPoint == m_currentPoint;
- if (!rx || !ry || arcIsZeroLength) {
- if (m_mode == RelativeCoordinates)
- m_currentPoint += targetPoint;
- else
- m_currentPoint = targetPoint;
- m_consumer->lineTo(m_currentPoint, AbsoluteCoordinates);
+ targetPoint += m_currentPoint;
+
+ if (!rx || !ry || targetPoint == m_currentPoint) {
+ m_consumer->lineTo(targetPoint, AbsoluteCoordinates);
+ m_currentPoint = targetPoint;
return true;
}
FloatPoint point1 = m_currentPoint;
- if (m_mode == RelativeCoordinates)
- targetPoint += m_currentPoint;
m_currentPoint = targetPoint;
return decomposeArcToCubic(angle, rx, ry, point1, targetPoint, largeArc, sweep);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698