Chromium Code Reviews| Index: Source/core/svg/SVGPathParser.cpp |
| diff --git a/Source/core/svg/SVGPathParser.cpp b/Source/core/svg/SVGPathParser.cpp |
| index 39eade0ce56f10a7c6fb346903188bf5ce824c60..261df8aebede839884bdc4e68040e9d0ffa5ae66 100644 |
| --- a/Source/core/svg/SVGPathParser.cpp |
| +++ b/Source/core/svg/SVGPathParser.cpp |
| @@ -246,6 +246,11 @@ bool SVGPathParser::parseArcToSegment() |
| if (!m_source->parseArcToSegment(rx, ry, angle, largeArc, sweep, targetPoint)) |
| return false; |
| + if (m_pathParsingMode == UnalteredParsing) { |
| + m_consumer->arcTo(rx, ry, angle, largeArc, sweep, targetPoint, m_mode); |
| + return true; |
| + } |
| + |
|
kouhei (in TOK)
2015/03/17 01:57:46
Nit: Might want to add ASSERT(m_pathParsingMode ==
fs
2015/03/17 09:28:28
With the follow-ups I have this is going to be mor
|
| // If rx = 0 or ry = 0 then this arc is treated as a straight line segment (a "lineto") joining the endpoints. |
| // http://www.w3.org/TR/SVG/implnote.html#ArcOutOfRangeParameters |
| // If the current point and target point for the arc are identical, it should be treated as a zero length |
| @@ -253,33 +258,24 @@ bool SVGPathParser::parseArcToSegment() |
| rx = fabsf(rx); |
| ry = fabsf(ry); |
| bool arcIsZeroLength = false; |
| - if (m_pathParsingMode == NormalizedParsing) { |
| + if (m_mode == RelativeCoordinates) |
| + arcIsZeroLength = targetPoint == FloatPoint::zero(); |
| + else |
| + arcIsZeroLength = targetPoint == m_currentPoint; |
| + if (!rx || !ry || arcIsZeroLength) { |
| if (m_mode == RelativeCoordinates) |
| - arcIsZeroLength = targetPoint == FloatPoint::zero(); |
| + m_currentPoint += targetPoint; |
| else |
| - arcIsZeroLength = targetPoint == m_currentPoint; |
| - } |
| - if (!rx || !ry || arcIsZeroLength) { |
| - if (m_pathParsingMode == NormalizedParsing) { |
| - if (m_mode == RelativeCoordinates) |
| - m_currentPoint += targetPoint; |
| - else |
| - m_currentPoint = targetPoint; |
| - m_consumer->lineTo(m_currentPoint, AbsoluteCoordinates); |
| - } else |
| - m_consumer->lineTo(targetPoint, m_mode); |
| + m_currentPoint = targetPoint; |
| + m_consumer->lineTo(m_currentPoint, AbsoluteCoordinates); |
| return true; |
| } |
| - if (m_pathParsingMode == NormalizedParsing) { |
| - FloatPoint point1 = m_currentPoint; |
| - if (m_mode == RelativeCoordinates) |
| - targetPoint += m_currentPoint; |
| - m_currentPoint = targetPoint; |
| - return decomposeArcToCubic(angle, rx, ry, point1, targetPoint, largeArc, sweep); |
| - } |
| - m_consumer->arcTo(rx, ry, angle, largeArc, sweep, targetPoint, m_mode); |
| - 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); |
| } |
| bool SVGPathParser::parsePathDataFromSource(PathParsingMode pathParsingMode, bool checkForInitialMoveTo) |