OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2002, 2003 The Karbon Developers | 2 * Copyright (C) 2002, 2003 The Karbon Developers |
3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> | 3 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> |
4 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> | 4 * Copyright (C) 2006, 2007 Rob Buis <buis@kde.org> |
5 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. | 5 * Copyright (C) 2007, 2009 Apple Inc. All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // At the end of the [closepath] command, the new current | 49 // At the end of the [closepath] command, the new current |
50 // point is set to the initial point of the current subpath. | 50 // point is set to the initial point of the current subpath. |
51 // [https://www.w3.org/TR/SVG/paths.html#PathDataClosePathCommand] | 51 // [https://www.w3.org/TR/SVG/paths.html#PathDataClosePathCommand] |
52 m_currentPoint = m_subpathPoint; | 52 m_currentPoint = m_subpathPoint; |
53 } | 53 } |
54 | 54 |
55 void SVGPathBuilder::emitMoveTo(const FloatPoint& p) | 55 void SVGPathBuilder::emitMoveTo(const FloatPoint& p) |
56 { | 56 { |
57 m_path.moveTo(p); | 57 m_path.moveTo(p); |
58 | 58 |
59 // If a "closepath" is followed immediately by a "moveto", then | 59 m_subpathPoint = p; |
60 // the "moveto" identifies the start point of the next subpath. | |
61 // [https://www.w3.org/TR/SVG/paths.html#PathDataClosePathCommand] | |
62 if (m_lastCommand == PathSegClosePath) | |
63 m_subpathPoint = p; | |
64 | |
65 m_currentPoint = p; | 60 m_currentPoint = p; |
66 } | 61 } |
67 | 62 |
68 void SVGPathBuilder::emitLineTo(const FloatPoint& p) | 63 void SVGPathBuilder::emitLineTo(const FloatPoint& p) |
69 { | 64 { |
70 m_path.addLineTo(p); | 65 m_path.addLineTo(p); |
71 m_currentPoint = p; | 66 m_currentPoint = p; |
72 } | 67 } |
73 | 68 |
74 void SVGPathBuilder::emitQuadTo(const FloatPoint& c0, const FloatPoint& p) | 69 void SVGPathBuilder::emitQuadTo(const FloatPoint& c0, const FloatPoint& p) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 segment.sweepFlag()); | 202 segment.sweepFlag()); |
208 break; | 203 break; |
209 default: | 204 default: |
210 ASSERT_NOT_REACHED(); | 205 ASSERT_NOT_REACHED(); |
211 } | 206 } |
212 | 207 |
213 m_lastCommand = segment.command; | 208 m_lastCommand = segment.command; |
214 } | 209 } |
215 | 210 |
216 } // namespace blink | 211 } // namespace blink |
OLD | NEW |